#!/usr/bin/env python
# coding=utf-8
"""
@Author  : youjia - 卞志伟
@file    : day_report_yj_ch_second_dao.py.py
@contact : bianzhiwei@iyoujia.com
@time    : 2019-11-18 09:45 
@Desc    : 
@Software: PyCharm
"""
import os
import sys

# 当前文件的路径
pwd, filename = os.path.split(os.path.abspath(__file__))
# 当前文件的父路径
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + ".")
# 当前文件的前两级目录
grader_father = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(pwd)
sys.path.append(father_path)
sys.path.append(grader_father)

from report_system.utils.log_util import log
from report_system.utils.num_util import percentage
from report_system.report_specify.comment_specify import comment_overview_district_channel
from report_system.report_specify.comment_specify import comment_overview_city_channel
from report_system.report_specify.comment_specify import comment_overview_work_channel
from report_system.report_specify.comment_specify import comment_overview_house_channel
from report_system.report_specify.service_specify import im_district
from report_system.report_specify.service_specify import im_city
from report_system.report_specify.service_specify import im_work_day
from report_system.report_specify.service_specify import im_house_day

from report_system.report_specify.service_specify import im_conversion_order_district_day_channel
from report_system.report_specify.service_specify import im_conversion_order_city_day_channel
from report_system.report_specify.service_specify import im_conversion_order_work_day_channel
from report_system.report_specify.service_specify import im_conversion_order_house_day_channel
from report_system.report_specify.yj_ch_second_demand_specify import *


def process_house_yesterday(dt=None, have_long=False, own_type=(1, 2, 3)):
    """
    过去七天
    :param dt:
    :param own_type:
    :param have_long: 是否包含长租
    :return:
    """
    yesterday = dt if dt else date_util.curdate()
    st = yesterday
    et = yesterday
    """
    【结果指标】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    situation_df = house_df_situation(st=st, et=et, have_long=have_long, own_type=own_type)
    situation_df = df_util.df_set_index(situation_df, ['房屋ID', '城市'])
    situation_df = df_util.df_set_first_title(situation_df, '房屋基础')
    log.info("处理【房屋基础】数据完成！！！")

    related_df = house_df_related(st=st, et=et, have_long=have_long, own_type=own_type)
    df_util.df_rename(related_df, {"在线天数": "是否在线"})
    related_df = df_util.df_set_index(related_df, '房屋ID')
    related_df = df_util.df_set_first_title(related_df, '房源相关')
    log.info("处理【房源相关】数据完成！！！")

    result_df = pd.merge(situation_df, related_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋基础、房源相关】数据完成！！！")

    check_rate_df = house_df_check_rate(st=st, et=et, have_long=have_long, own_type=own_type)
    house_check_future14_rate_df = house_df_check_future14_rate(st=st, et=et, have_long=have_long, own_type=own_type)
    check_rate_df = df_util.df_set_index(check_rate_df, '房屋ID')
    house_check_future14_rate_df = df_util.df_set_index(house_check_future14_rate_df, '房屋ID')
    check_rate_df = pd.merge(check_rate_df, house_check_future14_rate_df, how='left', left_index=True, right_index=True)
    check_rate_df = check_rate_df[["订单渠道", "有家订单编号", "可售入住率", "在线入住率", "未来14天可售入住率"]]
    check_rate_df = df_util.df_set_first_title(check_rate_df, '入住率')
    log.info("处理【入住率】数据完成！！！")

    result_df = pd.merge(result_df, check_rate_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋基础、房源相关、入住率】数据完成！！！")

    adr_df = house_df_adr(st=st, et=et, have_long=have_long, own_type=own_type)
    adr_df = df_util.df_set_index(adr_df, '房屋ID')
    adr_df = df_util.df_set_first_title(adr_df, 'ADR')
    log.info("处理【ADR】数据完成！！！")

    result_df = pd.merge(result_df, adr_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋基础、房源相关、入住率、ADR】数据完成！！！")

    """
    过程指标【综合】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    mul_im_recovery_df = im_house_day(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_recovery_df['IM回复时长'] = "-"
    mul_im_conversion_df = im_conversion_order_house_day_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_conversion_df = df_util.df_drop(mul_im_conversion_df, '咨询数')
    mul_im_df = pd.merge(mul_im_recovery_df, mul_im_conversion_df, how='left', left_index=True, right_index=True)
    mul_im_df = df_util.df_set_first_title(mul_im_df, 'IM相关-Airbnb')
    log.info("处理【IM相关-Airbnb】数据完成！！！")
    mul_im_rename = {"下单咨询数": "24小时咨询数", "下单数": "24小时咨询后下单数", "im咨询下单转化率": "咨询下单转化率"}
    mul_im_df = df_util.df_rename(mul_im_df, mul_im_rename)
    result_df = pd.merge(result_df, mul_im_df, how='left', left_index=True, right_index=True)

    comment_overview_house_df = comment_overview_house_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    comment_overview_house_df = df_util.df_drop(comment_overview_house_df, ["好评率", "差评率"])
    comment_overview_house_df = df_util.df_set_first_title(comment_overview_house_df, "评论相关-综合")
    result_df = pd.merge(result_df, comment_overview_house_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【评论相关】数据完成！！！")

    house_brush_df = house_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3, 20, 25], own_type=own_type)
    house_brush_df = df_util.df_set_index(house_brush_df, '房屋ID')
    # house_brush_df = house_brush_df[["刷单数", "入住间夜（含刷单）", "入住率（含刷单）"]]
    house_brush_df = df_util.df_set_first_title(house_brush_df, "刷单-综合")
    result_df = pd.merge(result_df, house_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-综合】 数据完成！！！")

    house_brush_df = house_df_brush(st=st, et=et, have_long=have_long, channel_ids=[20], own_type=own_type)
    house_brush_df = df_util.df_set_index(house_brush_df, '房屋ID')
    # house_brush_df = house_brush_df[["刷单数", "入住间夜（含刷单）", "入住率（含刷单）"]]
    house_brush_df = df_util.df_set_first_title(house_brush_df, "刷单-Airbnb")
    result_df = pd.merge(result_df, house_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-Airbnb】 数据完成！！！")

    house_brush_df = house_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3], own_type=own_type)
    house_brush_df = df_util.df_set_index(house_brush_df, '房屋ID')
    # house_brush_df = house_brush_df[["刷单数", "入住间夜（含刷单）", "入住率（含刷单）"]]
    house_brush_df = df_util.df_set_first_title(house_brush_df, "刷单-途家")
    result_df = pd.merge(result_df, house_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-途家】 数据完成！！！")

    house_brush_df = house_df_brush(st=st, et=et, have_long=have_long, channel_ids=[25], own_type=own_type)
    house_brush_df = df_util.df_set_index(house_brush_df, '房屋ID')
    # house_brush_df = house_brush_df[["刷单数", "入住间夜（含刷单）", "入住率（含刷单）"]]
    house_brush_df = df_util.df_set_first_title(house_brush_df, "刷单-榛果")
    result_df = pd.merge(result_df, house_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-榛果】 数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    house_channel_df = house_df_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    house_channel_df = df_util.df_set_index(house_channel_df, ['房屋ID'])
    house_channel_df = house_channel_df[["是否在线", "是否直连"]]
    house_channel_df = df_util.df_set_first_title(house_channel_df, "渠道相关-Airbnb")
    result_df = pd.merge(result_df, house_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    house_channel_df = house_df_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    house_channel_df = df_util.df_set_index(house_channel_df, ['房屋ID'])
    house_channel_df = house_channel_df[["是否在线", "是否直连"]]
    house_channel_df = df_util.df_set_first_title(house_channel_df, "渠道相关-途家")
    result_df = pd.merge(result_df, house_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    house_channel_df = house_df_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    house_channel_df = df_util.df_set_index(house_channel_df, ['房屋ID'])
    house_channel_df = house_channel_df[["是否在线", "是否直连"]]
    house_channel_df = df_util.df_set_first_title(house_channel_df, "渠道相关-榛果")
    result_df = pd.merge(result_df, house_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    house_third_lodge_id_df = house_df_third_lodge_id()
    house_third_lodge_id_df = df_util.df_set_index(house_third_lodge_id_df, '房屋ID')
    house_third_lodge_id_df = df_util.df_set_first_title(house_third_lodge_id_df, "第三方房源ID")
    result_df = pd.merge(result_df, house_third_lodge_id_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【第三方房源ID】数据完成！！！")

    result_df = df_util.df_reset_index(result_df)

    colors = {"房屋基础": "#F8E0E0", "房源相关": "#EFF5FB", "入住率": "#F7F8E0", "ADR": " #F1F8E0",
              "GMV": "#E0F8E6 ", "REPVAR": "#E0F8F7", "IM相关-Airbnb": "#F2EFFB",
              "虚拟电话": "#EFF2FB",
              "渠道相关-综合": "#F2F2F2", "刷单-综合": "#F8ECE0", "评论相关-综合": "#EFF8FB",
              "渠道相关-Airbnb": "#F2F2F2", "刷单-Airbnb": "#F8ECE0", "评论相关-Airbnb": "#EFF8FB",
              "渠道相关-途家": "#F2F2F2", "刷单-途家": "#F8ECE0", "评论相关-途家": "#EFF8FB",
              "渠道相关-榛果": "#F2F2F2", "刷单-榛果": "#F8ECE0", "评论相关-榛果": "#EFF8FB"}

    return result_df, colors


def process_house_seven_ago(dt=None, have_long=False, own_type=(1, 2, 3)):
    """
    过去七天
    :param dt:
    :param own_type:
    :param have_long: 是否包含长租
    :return:
    """
    yesterday = dt if dt else date_util.curdate()
    st = date_util.date_sub(dt=yesterday, days=6)
    et = yesterday
    """
    【结果指标】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    situation_df = house_df_situation(st=st, et=et, have_long=have_long, own_type=own_type)
    situation_df = df_util.df_set_index(situation_df, ['房屋ID', '城市'])
    situation_df = df_util.df_set_first_title(situation_df, '房屋基础')
    log.info("处理【房屋基础】数据完成！！！")

    related_df = house_df_related(st=st, et=et, have_long=have_long, own_type=own_type)
    related_df = df_util.df_set_index(related_df, '房屋ID')
    related_df = df_util.df_set_first_title(related_df, '房源相关')
    log.info("处理【房源相关】数据完成！！！")
    related_df = df_util.df_rename(related_df, {"在线天数": "在线间夜", "屏蔽天数": "关房天数"})

    result_df = pd.merge(situation_df, related_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋基础、房源相关】数据完成！！！")

    check_rate_df = house_df_check_rate(st=st, et=et, have_long=have_long, own_type=own_type)
    check_rate_df = df_util.df_drop(check_rate_df, ["订单渠道", "有家订单编号"])
    # check_rate_df = df_util.df_drop(check_rate_df, ["去年入住间夜", "去年在线入住率", "去年可售入住率"])
    check_rate_df = df_util.df_set_index(check_rate_df, '房屋ID')
    check_rate_df = df_util.df_set_first_title(check_rate_df, '入住率')
    log.info("处理【入住率】数据完成！！！")

    result_df = pd.merge(result_df, check_rate_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋基础、房源相关、入住率】数据完成！！！")
    # 可售天数入住率排名
    result_df = df_util.df_sort(result_df, ("入住率", "可售入住率排名"), ascending=True)

    adr_df = house_df_adr(st=st, et=et, have_long=have_long, own_type=own_type)
    adr_df = df_util.df_set_index(adr_df, '房屋ID')
    adr_df = df_util.df_drop(adr_df, ["去年ADR", "市场价格"])
    adr_df = df_util.df_set_first_title(adr_df, 'ADR')
    log.info("处理【ADR】数据完成！！！")

    result_df = pd.merge(result_df, adr_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋基础、房源相关、入住率、ADR】数据完成！！！")

    gmv_df = house_df_gmv(st=st, et=et, have_long=have_long, own_type=own_type)
    gmv_df = df_util.df_set_index(gmv_df, '房屋ID')
    month_days = date_util.month_days(date_util.curdate())
    gmv_df['GMV目标'] = gmv_df.apply(lambda row: round(row['GMV目标'] / month_days * 7, 2), axis=1)
    gmv_df['GMV目标差'] = gmv_df.apply(lambda row: round(row['GMV【不包含刷单】'] - row['GMV目标'], 2), axis=1)
    gmv_df = df_util.df_rename(gmv_df, {"GMV目标": "GMV七天目标", "GMV目标差": "GMV七天目标差"})

    gmv_df = df_util.df_set_first_title(gmv_df, 'GMV')
    log.info("处理【GMV】数据完成！！！")

    result_df = pd.merge(result_df, gmv_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋基础、房源相关、入住率、ADR、GMV】数据完成！！！")

    revpar_df = house_df_revpar(st=st, et=et, have_long=have_long, own_type=own_type)
    revpar_df = df_util.df_set_index(revpar_df, '房屋ID')
    revpar_df = df_util.df_drop(revpar_df, "去年REVPAR")
    revpar_df = df_util.df_set_first_title(revpar_df, 'REVPAR')
    log.info("处理【REPVAR】数据完成！！！")

    result_df = pd.merge(result_df, revpar_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋基础、房源相关、入住率、ADR、GMV、REPVAR】数据完成！！！")

    house_order_about_df = house_df_order_about(st=st, et=et, have_long=have_long, own_type=own_type)
    house_order_about_df = df_util.df_set_index(house_order_about_df, '房屋ID')
    house_order_about_df = df_util.df_set_first_title(house_order_about_df, '订单相关')
    result_df = pd.merge(result_df, house_order_about_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋基础、房源相关、入住率、ADR、GMV、REPVAR、订单相关】数据完成！！！")

    house_channel_order_rate_df = house_df_channel_order_rate(st=st, et=et, have_long=have_long, own_type=own_type)
    house_channel_order_rate_df = df_util.df_set_index(house_channel_order_rate_df, '房屋ID')
    house_channel_order_rate_df = df_util.df_set_first_title(house_channel_order_rate_df, '渠道占比')
    result_df = pd.merge(result_df, house_channel_order_rate_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋基础、房源相关、入住率、ADR、GMV、REPVAR、订单相关、渠道占比】数据完成！！！")

    """
    过程指标【综合】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    mul_im_recovery_df = im_house_day(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_conversion_df = im_conversion_order_house_day_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    rename_dict = {"咨询数": "24小时咨询数", "下单数": "24小时咨询后下单数", "im咨询下单转化率": "咨询下单转化率"}
    mul_im_conversion_df = df_util.df_rename(mul_im_conversion_df, rename_dict)
    mul_im_df = pd.merge(mul_im_recovery_df, mul_im_conversion_df, how='left', left_index=True, right_index=True)
    mul_im_df = df_util.df_set_first_title(mul_im_df, 'IM相关-Airbnb')
    log.info("处理【IM相关-Airbnb】数据完成！！！")
    result_df = pd.merge(result_df, mul_im_df, how='left', left_index=True, right_index=True)

    comment_overview_house_df = comment_overview_house_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    comment_overview_house_df = df_util.df_set_first_title(comment_overview_house_df, "评论相关-综合")
    result_df = pd.merge(result_df, comment_overview_house_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【评论相关-综合】数据完成！！！")

    comment_overview_house_df = comment_overview_house_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    comment_overview_house_df = df_util.df_set_first_title(comment_overview_house_df, "评论相关-Airbnb")
    result_df = pd.merge(result_df, comment_overview_house_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【评论相关-Airbnb】数据完成！！！")

    comment_overview_house_df = comment_overview_house_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    comment_overview_house_df = df_util.df_set_first_title(comment_overview_house_df, "评论相关-途家")
    result_df = pd.merge(result_df, comment_overview_house_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【评论相关-途家】数据完成！！！")

    comment_overview_house_df = comment_overview_house_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    comment_overview_house_df = df_util.df_set_first_title(comment_overview_house_df, "评论相关-榛果")
    result_df = pd.merge(result_df, comment_overview_house_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【评论相关-榛果】数据完成！！！")

    house_brush_df = house_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3, 20, 25], own_type=own_type)
    house_brush_df = df_util.df_set_index(house_brush_df, '房屋ID')
    house_brush_df = df_util.df_set_first_title(house_brush_df, "刷单-综合")
    result_df = pd.merge(result_df, house_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-综合】 数据完成！！！")

    house_brush_df = house_df_brush(st=st, et=et, have_long=have_long, channel_ids=[20], own_type=own_type)
    house_brush_df = df_util.df_set_index(house_brush_df, '房屋ID')
    house_brush_df = df_util.df_set_first_title(house_brush_df, "刷单-Airbnb")
    result_df = pd.merge(result_df, house_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-Airbnb】 数据完成！！！")

    house_brush_df = house_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3], own_type=own_type)
    house_brush_df = df_util.df_set_index(house_brush_df, '房屋ID')
    house_brush_df = df_util.df_set_first_title(house_brush_df, "刷单-途家")
    result_df = pd.merge(result_df, house_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-途家】 数据完成！！！")

    house_brush_df = house_df_brush(st=st, et=et, have_long=have_long, channel_ids=[25], own_type=own_type)
    house_brush_df = df_util.df_set_index(house_brush_df, '房屋ID')
    house_brush_df = df_util.df_set_first_title(house_brush_df, "刷单-榛果")
    result_df = pd.merge(result_df, house_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-榛果】 数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    house_channel_df = house_df_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    house_channel_df = df_util.df_set_index(house_channel_df, ['房屋ID'])
    house_channel_df = house_channel_df[["直连在线率", "渠道直连率"]]
    house_channel_df = df_util.df_set_first_title(house_channel_df, "渠道相关-综合")
    result_df = pd.merge(result_df, house_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    house_channel_df = house_df_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    house_channel_df = df_util.df_set_index(house_channel_df, ['房屋ID'])
    house_channel_df = house_channel_df[["直连在线率", "渠道直连率"]]
    house_channel_df = df_util.df_set_first_title(house_channel_df, "渠道相关-Airbnb")
    result_df = pd.merge(result_df, house_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【渠道相关】数据完成！！！")

    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    house_channel_df = house_df_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    house_channel_df = df_util.df_set_index(house_channel_df, ['房屋ID'])
    house_channel_df = house_channel_df[["直连在线率", "渠道直连率"]]
    house_channel_df = df_util.df_set_first_title(house_channel_df, "渠道相关-途家")
    result_df = pd.merge(result_df, house_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    house_channel_df = house_df_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    house_channel_df = df_util.df_set_index(house_channel_df, ['房屋ID'])
    house_channel_df = house_channel_df[["直连在线率", "渠道直连率"]]
    house_channel_df = df_util.df_set_first_title(house_channel_df, "渠道相关-榛果")
    result_df = pd.merge(result_df, house_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    house_third_lodge_id_df = house_df_third_lodge_id()
    house_third_lodge_id_df = df_util.df_set_index(house_third_lodge_id_df, '房屋ID')
    house_third_lodge_id_df = df_util.df_set_first_title(house_third_lodge_id_df, "第三方房源ID")
    result_df = pd.merge(result_df, house_third_lodge_id_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【第三方房源ID】数据完成！！！")

    result_df = df_util.df_reset_index(result_df)

    colors = {"房屋基础": "#F8E0E0", "房源相关": "#EFF5FB", "入住率": "#F7F8E0", "ADR": " #F1F8E0",
              "GMV": "#E0F8E6 ", "REPVAR": "#E0F8F7", "IM相关-Airbnb": "#F2EFFB",
              "虚拟电话": "#EFF2FB",
              "渠道相关-综合": "#F2F2F2", "刷单-综合": "#F8ECE0", "评论相关-综合": "#EFF8FB",
              "渠道相关-Airbnb": "#F2F2F2", "刷单-Airbnb": "#F8ECE0", "评论相关-Airbnb": "#EFF8FB",
              "渠道相关-途家": "#F2F2F2", "刷单-途家": "#F8ECE0", "评论相关-途家": "#EFF8FB",
              "渠道相关-榛果": "#F2F2F2", "刷单-榛果": "#F8ECE0", "评论相关-榛果": "#EFF8FB"}

    return result_df, colors


def process_house_month(dt=None, have_long=False, own_type=(1, 2, 3)):
    """
    过去七天
    :param dt:
    :param own_type:
    :param have_long: 是否包含长租
    :return:
    """
    yesterday = dt if dt else date_util.curdate()
    st = date_util.cur_month_first(days=1, dt=yesterday)
    et = yesterday
    """
    【结果指标】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    situation_df = house_df_situation(st=st, et=et, have_long=have_long, own_type=own_type)
    situation_df = df_util.df_set_index(situation_df, ['房屋ID', '城市'])
    situation_df = df_util.df_set_first_title(situation_df, '房屋基础')
    log.info("处理【房屋基础】数据完成！！！")

    related_df = house_df_related(st=st, et=et, have_long=have_long, own_type=own_type)
    related_df = df_util.df_set_index(related_df, '房屋ID')
    related_df = df_util.df_set_first_title(related_df, '房源相关')
    log.info("处理【房源相关】数据完成！！！")
    related_df = df_util.df_rename(related_df, {"在线天数": "在线间夜", "屏蔽天数": "关房天数"})

    result_df = pd.merge(situation_df, related_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋基础、房源相关】数据完成！！！")

    check_rate_df = house_df_check_rate(st=st, et=et, have_long=have_long, own_type=own_type)
    check_rate_df = df_util.df_drop(check_rate_df, ["订单渠道", "有家订单编号"])
    # check_rate_df = df_util.df_drop(check_rate_df, ["去年入住间夜", "去年在线入住率", "去年可售入住率"])
    check_rate_df = df_util.df_set_index(check_rate_df, '房屋ID')
    check_rate_df = df_util.df_set_first_title(check_rate_df, '入住率')
    log.info("处理【入住率】数据完成！！！")

    result_df = pd.merge(result_df, check_rate_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋基础、房源相关、入住率】数据完成！！！")
    # 可售天数入住率排名
    result_df = df_util.df_sort(result_df, ("入住率", "可售入住率排名"), ascending=True)

    adr_df = house_df_adr(st=st, et=et, have_long=have_long, own_type=own_type)
    adr_df = df_util.df_set_index(adr_df, '房屋ID')
    adr_df = df_util.df_drop(adr_df, ["去年ADR", "市场价格"])
    adr_df = df_util.df_set_first_title(adr_df, 'ADR')
    log.info("处理【ADR】数据完成！！！")

    result_df = pd.merge(result_df, adr_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋基础、房源相关、入住率、ADR】数据完成！！！")

    gmv_df = house_df_gmv(st=st, et=et, have_long=have_long, own_type=own_type)
    gmv_df = df_util.df_set_index(gmv_df, '房屋ID')
    gmv_df = df_util.df_rename(gmv_df, {"GMV目标": "GMV月度目标", "GMV目标差": "GMV月度目标差"})
    gmv_df = df_util.df_set_first_title(gmv_df, 'GMV')
    log.info("处理【GMV】数据完成！！！")

    result_df = pd.merge(result_df, gmv_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋基础、房源相关、入住率、ADR、GMV】数据完成！！！")

    revpar_df = house_df_revpar(st=st, et=et, have_long=have_long, own_type=own_type)
    revpar_df = df_util.df_set_index(revpar_df, '房屋ID')
    revpar_df = df_util.df_drop(revpar_df, "去年REVPAR")
    revpar_df = df_util.df_set_first_title(revpar_df, 'REVPAR')
    log.info("处理【REPVAR】数据完成！！！")

    result_df = pd.merge(result_df, revpar_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋基础、房源相关、入住率、ADR、GMV、REPVAR】数据完成！！！")

    house_order_about_df = house_df_order_about(st=st, et=et, have_long=have_long, own_type=own_type)
    house_order_about_df = df_util.df_set_index(house_order_about_df, '房屋ID')
    house_order_about_df = df_util.df_set_first_title(house_order_about_df, '订单相关')
    result_df = pd.merge(result_df, house_order_about_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋基础、房源相关、入住率、ADR、GMV、REPVAR、订单相关】数据完成！！！")

    house_channel_order_rate_df = house_df_channel_order_rate(st=st, et=et, have_long=have_long, own_type=own_type)
    house_channel_order_rate_df = df_util.df_set_index(house_channel_order_rate_df, '房屋ID')
    house_channel_order_rate_df = df_util.df_set_first_title(house_channel_order_rate_df, '渠道占比')
    result_df = pd.merge(result_df, house_channel_order_rate_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋基础、房源相关、入住率、ADR、GMV、REPVAR、订单相关、渠道占比】数据完成！！！")

    """
    过程指标【综合】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    mul_im_recovery_df = im_house_day(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_conversion_df = im_conversion_order_house_day_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    rename_dict = {"咨询数": "24小时咨询数", "下单数": "24小时咨询后下单数", "im咨询下单转化率": "咨询下单转化率"}
    mul_im_conversion_df = df_util.df_rename(mul_im_conversion_df, rename_dict)
    mul_im_df = pd.merge(mul_im_recovery_df, mul_im_conversion_df, how='left', left_index=True, right_index=True)
    mul_im_df = df_util.df_set_first_title(mul_im_df, 'IM相关-Airbnb')
    log.info("处理【IM相关-Airbnb】数据完成！！！")
    result_df = pd.merge(result_df, mul_im_df, how='left', left_index=True, right_index=True)

    comment_overview_house_df = comment_overview_house_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    comment_overview_house_df = df_util.df_set_first_title(comment_overview_house_df, "评论相关-综合")
    result_df = pd.merge(result_df, comment_overview_house_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【评论相关-综合】数据完成！！！")

    comment_overview_house_df = comment_overview_house_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    comment_overview_house_df = df_util.df_set_first_title(comment_overview_house_df, "评论相关-Airbnb")
    result_df = pd.merge(result_df, comment_overview_house_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【评论相关-Airbnb】数据完成！！！")

    comment_overview_house_df = comment_overview_house_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    comment_overview_house_df = df_util.df_set_first_title(comment_overview_house_df, "评论相关-途家")
    result_df = pd.merge(result_df, comment_overview_house_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【评论相关-途家】数据完成！！！")

    comment_overview_house_df = comment_overview_house_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    comment_overview_house_df = df_util.df_set_first_title(comment_overview_house_df, "评论相关-榛果")
    result_df = pd.merge(result_df, comment_overview_house_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【评论相关-榛果】数据完成！！！")

    house_brush_df = house_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3, 20, 25], own_type=own_type)
    house_brush_df = df_util.df_set_index(house_brush_df, '房屋ID')
    house_brush_df = df_util.df_set_first_title(house_brush_df, "刷单-综合")
    result_df = pd.merge(result_df, house_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-综合】 数据完成！！！")

    house_brush_df = house_df_brush(st=st, et=et, have_long=have_long, channel_ids=[20], own_type=own_type)
    house_brush_df = df_util.df_set_index(house_brush_df, '房屋ID')
    house_brush_df = df_util.df_set_first_title(house_brush_df, "刷单-Airbnb")
    result_df = pd.merge(result_df, house_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-Airbnb】 数据完成！！！")

    house_brush_df = house_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3], own_type=own_type)
    house_brush_df = df_util.df_set_index(house_brush_df, '房屋ID')
    house_brush_df = df_util.df_set_first_title(house_brush_df, "刷单-途家")
    result_df = pd.merge(result_df, house_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-途家】 数据完成！！！")

    house_brush_df = house_df_brush(st=st, et=et, have_long=have_long, channel_ids=[25], own_type=own_type)
    house_brush_df = df_util.df_set_index(house_brush_df, '房屋ID')
    house_brush_df = df_util.df_set_first_title(house_brush_df, "刷单-榛果")
    result_df = pd.merge(result_df, house_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-榛果】 数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    house_channel_df = house_df_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    house_channel_df = df_util.df_set_index(house_channel_df, ['房屋ID'])
    house_channel_df = house_channel_df[["直连在线率", "渠道直连率"]]
    house_channel_df = df_util.df_set_first_title(house_channel_df, "渠道相关-综合")
    result_df = pd.merge(result_df, house_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    house_channel_df = house_df_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    house_channel_df = df_util.df_set_index(house_channel_df, ['房屋ID'])
    house_channel_df = house_channel_df[["直连在线率", "渠道直连率"]]
    house_channel_df = df_util.df_set_first_title(house_channel_df, "渠道相关-Airbnb")
    result_df = pd.merge(result_df, house_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【渠道相关】数据完成！！！")

    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    house_channel_df = house_df_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    house_channel_df = df_util.df_set_index(house_channel_df, ['房屋ID'])
    house_channel_df = house_channel_df[["直连在线率", "渠道直连率"]]
    house_channel_df = df_util.df_set_first_title(house_channel_df, "渠道相关-途家")
    result_df = pd.merge(result_df, house_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    house_channel_df = house_df_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    house_channel_df = df_util.df_set_index(house_channel_df, ['房屋ID'])
    house_channel_df = house_channel_df[["直连在线率", "渠道直连率"]]
    house_channel_df = df_util.df_set_first_title(house_channel_df, "渠道相关-榛果")
    result_df = pd.merge(result_df, house_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    house_third_lodge_id_df = house_df_third_lodge_id()
    house_third_lodge_id_df = df_util.df_set_index(house_third_lodge_id_df, '房屋ID')
    house_third_lodge_id_df = df_util.df_set_first_title(house_third_lodge_id_df, "第三方房源ID")
    result_df = pd.merge(result_df, house_third_lodge_id_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【第三方房源ID】数据完成！！！")

    result_df = df_util.df_reset_index(result_df)

    colors = {"房屋基础": "#F8E0E0", "房源相关": "#EFF5FB", "入住率": "#F7F8E0", "ADR": " #F1F8E0",
              "GMV": "#E0F8E6 ", "REPVAR": "#E0F8F7", "IM相关-Airbnb": "#F2EFFB",
              "虚拟电话": "#EFF2FB",
              "渠道相关-综合": "#F2F2F2", "刷单-综合": "#F8ECE0", "评论相关-综合": "#EFF8FB",
              "渠道相关-Airbnb": "#F2F2F2", "刷单-Airbnb": "#F8ECE0", "评论相关-Airbnb": "#EFF8FB",
              "渠道相关-途家": "#F2F2F2", "刷单-途家": "#F8ECE0", "评论相关-途家": "#EFF8FB",
              "渠道相关-榛果": "#F2F2F2", "刷单-榛果": "#F8ECE0", "评论相关-榛果": "#EFF8FB"}

    return result_df, colors


def process_work_yesterday(dt=None, have_long=False, own_type=(1, 2, 3)):
    """
    过去七天
    :param dt:
    :param own_type:
    :param have_long: 是否包含长租
    :return:
    """
    yesterday = dt if dt else date_util.curdate()
    st = yesterday
    et = yesterday

    related_df = work_df_related(st=st, et=et, have_long=have_long, own_type=own_type)
    related_df = df_util.df_set_index(related_df, ['城市', '门店'])
    related_df = df_util.df_rename(related_df, {"屏蔽间夜": "屏蔽房源"})
    # related_df = df_util.df_drop(related_df, ["同期在线房屋", "在线间夜"])
    related_df = df_util.df_set_first_title(related_df, '房屋相关')
    log.info("处理【房屋相关】数据完成！！！")

    check_df = work_df_check(st=st, et=et, have_long=have_long, own_type=own_type)
    check_df = df_util.df_set_index(check_df, ['城市', '门店'])
    check_df = df_util.df_drop(check_df, "去年可售入住率")
    check_future14_df = work_df_check_future14(st=st, et=et, have_long=have_long, own_type=own_type)
    check_future14_df = df_util.df_set_index(check_future14_df, ['城市', '门店'])
    check_df = pd.merge(check_df, check_future14_df, how='left', left_index=True, right_index=True)
    check_df = df_util.df_set_first_title(check_df, '入住率')
    log.info("处理【入住率】数据完成！！！")

    result_df = pd.merge(related_df, check_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率】数据完成！！！")

    adr_df = work_df_adr(st=st, et=et, have_long=have_long, own_type=own_type)
    adr_df = df_util.df_set_index(adr_df, ['城市', '门店'])
    adr_df = df_util.df_drop(adr_df, "去年ADR")
    adr_future14_df = work_df_adr_future14(st=st, et=et, have_long=have_long, own_type=own_type)
    adr_future14_df = df_util.df_set_index(adr_future14_df, ['城市', '门店'])
    adr_df = pd.merge(adr_df, adr_future14_df, how='left', left_index=True, right_index=True)
    adr_df = df_util.df_set_first_title(adr_df, 'ADR')
    log.info("处理【ADR】数据完成！！！")

    result_df = pd.merge(result_df, adr_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR】数据完成！！！")

    revpar_df = work_df_revpar(st=st, et=et, have_long=have_long, own_type=own_type)
    revpar_df = df_util.df_set_index(revpar_df, ['城市', '门店'])
    revpar_df = df_util.df_drop(revpar_df, "去年RevPar")
    revpar_df = df_util.df_set_first_title(revpar_df, 'RevPar')
    log.info("处理【RevPar】数据完成！！！")

    result_df = pd.merge(result_df, revpar_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar】数据完成！！！")

    # gmv_df = work_df_gmv(st=st, et=et, have_long=have_long)
    # gmv_df = df_util.df_set_index(gmv_df, ['公司', '城市', '门店'])
    # gmv_df = df_util.df_set_first_title(gmv_df, 'GMV')
    # log.info("处理【GMV】数据完成！！！")
    #
    # result_df = pd.merge(result_df, gmv_df, how='left', left_index=True, right_index=True)
    # log.info("合并【房屋相关、入住率、ADR、RevPar、GMV】数据完成！！！")

    orders_df = work_df_create_orders_num(st=st, et=et, have_long=have_long, own_type=own_type)
    orders_df = df_util.df_set_index(orders_df, ['城市', '门店'])
    orders_df = orders_df[['取消订单收入', '退款率']]
    orders_df = df_util.df_set_first_title(orders_df, '订单相关')
    log.info("处理【订单相关】数据完成！！！")

    result_df = pd.merge(result_df, orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关】数据完成！！！")

    channel_orders_df = work_df_channel_order_rate(st=st, et=et, have_long=have_long, own_type=own_type)
    channel_orders_df = df_util.df_set_index(channel_orders_df, ['城市', '门店'])
    channel_orders_df = df_util.df_set_first_title(channel_orders_df, '渠道占比')
    log.info("处理【渠道占比】数据完成！！！")

    result_df = pd.merge(result_df, channel_orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关、渠道占比】数据完成！！！")

    """
    过程指标【综合】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    mul_im_recovery_df = im_work_day(st=st, et=et, channel_ids=[20], has_first=False, own_type=own_type)
    mul_im_recovery_df = df_util.df_set_index(mul_im_recovery_df, ['城市', '门店'])
    mul_im_conversion_df = im_conversion_order_work_day_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_rename = {"咨询数": "24小时咨询数", "下单数": "24小时咨询后下单数"}
    mul_im_conversion_df = df_util.df_rename(mul_im_conversion_df, mul_im_rename)
    mul_im_df = pd.merge(mul_im_recovery_df, mul_im_conversion_df, how='left', left_index=True, right_index=True)
    mul_im_df = df_util.df_set_first_title(mul_im_df, 'IM相关-Airbnb')
    log.info("处理【IM相关-Airbnb】数据完成！！！")
    result_df = pd.merge(result_df, mul_im_df, how='left', left_index=True, right_index=True)

    # comment_overview_work_df = comment_overview_work_channel(st=st, et=et, channel_ids=[3, 20, 25])
    # comment_overview_work_df = df_util.df_set_first_title(comment_overview_work_df, "评论相关-综合")
    # result_df = pd.merge(result_df, comment_overview_work_df, how='left', left_index=True, right_index=True)
    # log.info("处理【过程指标-综合】【评论相关】数据完成！！！")

    comment_overview_work_df = comment_overview_work_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    comment_overview_work_df = df_util.df_set_first_title(comment_overview_work_df, "评论相关-Airbnb")
    result_df = pd.merge(result_df, comment_overview_work_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【评论相关】数据完成！！！")

    comment_overview_work_df = comment_overview_work_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    comment_overview_work_df = df_util.df_set_first_title(comment_overview_work_df, "评论相关-途家")
    result_df = pd.merge(result_df, comment_overview_work_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【评论相关】数据完成！！！")

    # comment_overview_work_df = comment_overview_work_channel(st=st, et=et, channel_ids=[25])
    # comment_overview_work_df = df_util.df_set_first_title(comment_overview_work_df, "评论相关-榛果")
    # result_df = pd.merge(result_df, comment_overview_work_df, how='left', left_index=True, right_index=True)
    # log.info("处理【过程指标-榛果】【评论相关】数据完成！！！")

    work_brush_df = work_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3, 20, 25], own_type=own_type)
    work_brush_df = df_util.df_set_index(work_brush_df, ['城市', '门店'])
    work_brush_df = df_util.df_set_first_title(work_brush_df, "刷单-综合")
    result_df = pd.merge(result_df, work_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-综合】 数据完成！！！1111")

    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
    work_brush_df = work_df_brush(st=st, et=et, have_long=have_long, channel_ids=[20], own_type=own_type)
    work_brush_df = df_util.df_set_index(work_brush_df, ['城市', '门店'])
    work_brush_df = df_util.df_set_first_title(work_brush_df, "刷单-Airbnb")
    result_df = pd.merge(result_df, work_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-Airbnb】 数据完成！！！")

    work_brush_df = work_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3], own_type=own_type)
    work_brush_df = df_util.df_set_index(work_brush_df, ['城市', '门店'])
    work_brush_df = df_util.df_set_first_title(work_brush_df, "刷单-途家")
    result_df = pd.merge(result_df, work_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-途家】 数据完成！！！")

    work_brush_df = work_df_brush(st=st, et=et, have_long=have_long, channel_ids=[25], own_type=own_type)
    work_brush_df = df_util.df_set_index(work_brush_df, ['城市', '门店'])
    work_brush_df = df_util.df_set_first_title(work_brush_df, "刷单-榛果")
    result_df = pd.merge(result_df, work_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-榛果】 数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    work_channel_df = work_df_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    work_channel_df = df_util.df_set_index(work_channel_df, ['城市', '门店'])
    work_channel_df = df_util.df_set_first_title(work_channel_df, "渠道相关-综合")
    result_df = pd.merge(result_df, work_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    work_channel_df = work_df_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    work_channel_df = df_util.df_set_index(work_channel_df, ['城市', '门店'])
    work_channel_df = df_util.df_set_first_title(work_channel_df, "渠道相关-Airbnb")
    result_df = pd.merge(result_df, work_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【渠道相关】数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    work_channel_df = work_df_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    work_channel_df = df_util.df_set_index(work_channel_df, ['城市', '门店'])
    work_channel_df = df_util.df_set_first_title(work_channel_df, "渠道相关-途家")
    result_df = pd.merge(result_df, work_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    work_channel_df = work_df_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    work_channel_df = df_util.df_set_index(work_channel_df, ['城市', '门店'])
    work_channel_df = df_util.df_set_first_title(work_channel_df, "渠道相关-榛果")
    result_df = pd.merge(result_df, work_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    result_df = df_util.df_reset_index(result_df)

    colors = {"房屋相关": "#F8E0E0", "入住率": "#F7F8E0", "ADR": " #F1F8E0",
              "GMV": "#E0F8E6 ", "REPVAR": "#E0F8F7", "IM相关-Airbnb": "#F2EFFB",
              "虚拟电话": "#EFF2FB", "订单相关": "#EFFBF5",
              "渠道相关-综合": "#F2F2F2", "刷单-综合": "#F2F2F2", "评论相关-综合": "#F2F2F2",
              "渠道相关-Airbnb": "#F8ECE0", "刷单-Airbnb": "#F8ECE0", "评论相关-Airbnb": "#F8ECE0",
              "渠道相关-途家": "#EFF8FB", "刷单-途家": "#EFF8FB", "评论相关-途家": "#EFF8FB",
              "渠道相关-榛果": "#EFFBF2", "刷单-榛果": "#EFFBF2", "评论相关-榛果": "#EFFBF2"}

    return result_df, colors


def process_work_seven_ago(dt=None, have_long=False, own_type=(1, 2, 3)):
    """
    过去七天
    :param dt:
    :param own_type:
    :param have_long: 是否包含长租
    :return:
    """
    yesterday = dt if dt else date_util.curdate()
    st = date_util.date_sub(dt=yesterday, days=6)
    et = yesterday

    related_df = work_df_related(st=st, et=et, have_long=have_long, own_type=own_type)
    related_df = df_util.df_set_index(related_df, ['城市', '门店'])
    related_df = df_util.df_set_first_title(related_df, '房屋相关')
    log.info("处理【房屋相关】数据完成！！！")

    check_df = work_df_check(st=st, et=et, have_long=have_long, own_type=own_type)
    check_df = df_util.df_set_index(check_df, ['城市', '门店'])
    check_df = df_util.df_drop(check_df, "去年可售入住率")
    # check_future14_df = work_df_check_future14(st=st, et=et, have_long=have_long)
    # check_future14_df = df_util.df_set_index(check_future14_df, ['公司', '城市', '门店'])
    # check_df = pd.merge(check_df, check_future14_df, how='left', left_index=True, right_index=True)
    check_df = df_util.df_set_first_title(check_df, '入住率')
    log.info("处理【入住率】数据完成！！！")

    result_df = pd.merge(related_df, check_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率】数据完成！！！")

    adr_df = work_df_adr(st=st, et=et, have_long=have_long, own_type=own_type)
    adr_df = df_util.df_set_index(adr_df, ['城市', '门店'])
    adr_df = df_util.df_drop(adr_df, "去年ADR")
    adr_df = df_util.df_set_first_title(adr_df, 'ADR')
    log.info("处理【ADR】数据完成！！！")

    result_df = pd.merge(result_df, adr_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR】数据完成！！！")

    revpar_df = work_df_revpar(st=st, et=et, have_long=have_long, own_type=own_type)
    revpar_df = df_util.df_set_index(revpar_df, ['城市', '门店'])
    revpar_df = df_util.df_drop(revpar_df, "去年RevPar")
    revpar_df = df_util.df_set_first_title(revpar_df, 'RevPar')
    log.info("处理【RevPar】数据完成！！！")

    result_df = pd.merge(result_df, revpar_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar】数据完成！！！")

    gmv_df = work_df_gmv(st=st, et=et, have_long=have_long, own_type=own_type)
    gmv_df = df_util.df_set_index(gmv_df, ['城市', '门店'])
    month_days = date_util.month_days(date_util.curdate())
    gmv_df['GMV目标'] = gmv_df.apply(lambda row: round(row['GMV目标'] / month_days * 7, 2), axis=1)
    gmv_df['GMV目标差'] = gmv_df.apply(lambda row: round(row['套均GMV【不包含刷单】'] - row['GMV目标'], 2), axis=1)
    gmv_df = df_util.df_rename(gmv_df, {"GMV目标": "七天套均GMV目标", "GMV目标差": "七天套均GMV目标差"})
    gmv_df = df_util.df_set_first_title(gmv_df, 'GMV')
    log.info("处理【GMV】数据完成！！！")

    result_df = pd.merge(result_df, gmv_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV】数据完成！！！")

    orders_df = work_df_create_orders_num(st=st, et=et, have_long=have_long, own_type=own_type)
    orders_df = df_util.df_set_index(orders_df, ['城市', '门店'])
    orders_df = orders_df[['取消订单收入', '退款率']]
    orders_df = df_util.df_set_first_title(orders_df, '订单相关')
    log.info("处理【订单相关】数据完成！！！")

    result_df = pd.merge(result_df, orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关】数据完成！！！")

    channel_orders_df = work_df_channel_order_rate(st=st, et=et, have_long=have_long, own_type=own_type)
    channel_orders_df = df_util.df_set_index(channel_orders_df, ['城市', '门店'])
    channel_orders_df = df_util.df_set_first_title(channel_orders_df, '渠道占比')
    log.info("处理【渠道占比】数据完成！！！")

    result_df = pd.merge(result_df, channel_orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关、渠道占比】数据完成！！！")

    """
    过程指标【综合】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    mul_im_recovery_df = im_work_day(st=st, et=et, channel_ids=[20], has_first=False, own_type=own_type)
    mul_im_recovery_df = df_util.df_set_index(mul_im_recovery_df, ['城市', '门店'])
    mul_im_conversion_df = im_conversion_order_work_day_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_rename = {"咨询数": "24小时咨询数", "下单数": "24小时咨询后下单数"}
    mul_im_conversion_df = df_util.df_rename(mul_im_conversion_df, mul_im_rename)
    mul_im_df = pd.merge(mul_im_recovery_df, mul_im_conversion_df, how='left', left_index=True, right_index=True)
    mul_im_df = df_util.df_set_first_title(mul_im_df, 'IM相关-Airbnb')
    log.info("处理【IM相关-Airbnb】数据完成！！！")
    result_df = pd.merge(result_df, mul_im_df, how='left', left_index=True, right_index=True)

    comment_overview_work_df = comment_overview_work_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    comment_overview_work_df = df_util.df_set_first_title(comment_overview_work_df, "评论相关-综合")
    result_df = pd.merge(result_df, comment_overview_work_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【评论相关】数据完成！！！")

    comment_overview_work_df = comment_overview_work_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    comment_overview_work_df = df_util.df_set_first_title(comment_overview_work_df, "评论相关-Airbnb")
    result_df = pd.merge(result_df, comment_overview_work_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【评论相关】数据完成！！！")

    comment_overview_work_df = comment_overview_work_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    comment_overview_work_df = df_util.df_set_first_title(comment_overview_work_df, "评论相关-途家")
    result_df = pd.merge(result_df, comment_overview_work_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【评论相关】数据完成！！！")

    comment_overview_work_df = comment_overview_work_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    comment_overview_work_df = df_util.df_set_first_title(comment_overview_work_df, "评论相关-榛果")
    result_df = pd.merge(result_df, comment_overview_work_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【评论相关】数据完成！！！")

    work_brush_df = work_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3, 20, 25], own_type=own_type)
    work_brush_df = df_util.df_set_index(work_brush_df, ['城市', '门店'])
    work_brush_df = df_util.df_set_first_title(work_brush_df, "刷单-综合")
    result_df = pd.merge(result_df, work_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-综合】 数据完成！！！")

    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
    work_brush_df = work_df_brush(st=st, et=et, have_long=have_long, channel_ids=[20], own_type=own_type)
    work_brush_df = df_util.df_set_index(work_brush_df, ['城市', '门店'])
    work_brush_df = df_util.df_set_first_title(work_brush_df, "刷单-Airbnb")
    result_df = pd.merge(result_df, work_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-Airbnb】 数据完成！！！")

    work_brush_df = work_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3], own_type=own_type)
    work_brush_df = df_util.df_set_index(work_brush_df, ['城市', '门店'])
    work_brush_df = df_util.df_set_first_title(work_brush_df, "刷单-途家")
    result_df = pd.merge(result_df, work_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-途家】 数据完成！！！")

    work_brush_df = work_df_brush(st=st, et=et, have_long=have_long, channel_ids=[25], own_type=own_type)
    work_brush_df = df_util.df_set_index(work_brush_df, ['城市', '门店'])
    work_brush_df = df_util.df_set_first_title(work_brush_df, "刷单-榛果")
    result_df = pd.merge(result_df, work_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-榛果】 数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    work_channel_df = work_df_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    work_channel_df = df_util.df_set_index(work_channel_df, ['城市', '门店'])
    work_channel_df = df_util.df_set_first_title(work_channel_df, "渠道相关-综合")
    result_df = pd.merge(result_df, work_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    work_channel_df = work_df_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    work_channel_df = df_util.df_set_index(work_channel_df, ['城市', '门店'])
    work_channel_df = df_util.df_set_first_title(work_channel_df, "渠道相关-Airbnb")
    result_df = pd.merge(result_df, work_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【渠道相关】数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    work_channel_df = work_df_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    work_channel_df = df_util.df_set_index(work_channel_df, ['城市', '门店'])
    work_channel_df = df_util.df_set_first_title(work_channel_df, "渠道相关-途家")
    result_df = pd.merge(result_df, work_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    work_channel_df = work_df_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    work_channel_df = df_util.df_set_index(work_channel_df, ['城市', '门店'])
    work_channel_df = df_util.df_set_first_title(work_channel_df, "渠道相关-榛果")
    result_df = pd.merge(result_df, work_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓净利（非结算数据）后期补充 净利（非结算数据）↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    net_profit_df = work_df_net_profit(st=st, et=et, own_type=own_type)
    net_profit_df = df_util.df_set_first_title(net_profit_df, "净利（非结算数据）")
    # net_profit_df = df_util.df_set_index(net_profit_df, [ '城市', '门店'])
    result_df = pd.merge(result_df, net_profit_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【净利（非结算数据）】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑净利（非结算数据）后期补充 净利（非结算数据）↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    result_df = df_util.df_reset_index(result_df)

    colors = {"房屋相关": "#F8E0E0", "入住率": "#F7F8E0", "ADR": " #F1F8E0",
              "GMV": "#E0F8E6 ", "REPVAR": "#E0F8F7", "IM相关-Airbnb": "#F2EFFB",
              "虚拟电话": "#EFF2FB", "订单相关": "#EFFBF5",
              "渠道相关-综合": "#F2F2F2", "刷单-综合": "#F2F2F2", "评论相关-综合": "#F2F2F2",
              "渠道相关-Airbnb": "#F8ECE0", "刷单-Airbnb": "#F8ECE0", "评论相关-Airbnb": "#F8ECE0",
              "渠道相关-途家": "#EFF8FB", "刷单-途家": "#EFF8FB", "评论相关-途家": "#EFF8FB",
              "渠道相关-榛果": "#EFFBF2", "刷单-榛果": "#EFFBF2", "评论相关-榛果": "#EFFBF2"}

    return result_df, colors


def process_work_month(dt=None, have_long=False, own_type=(1, 2, 3)):
    """
    过去七天
    :param dt:
    :param own_type:
    :param have_long: 是否包含长租
    :return:
    """
    yesterday = dt if dt else date_util.curdate()
    st = date_util.cur_month_first(days=1, dt=yesterday)
    et = yesterday

    related_df = work_df_related(st=st, et=et, have_long=have_long, own_type=own_type)
    related_df = df_util.df_set_index(related_df, ['城市', '门店'])
    related_df = df_util.df_set_first_title(related_df, '房屋相关')
    log.info("处理【房屋相关】数据完成！！！")

    check_df = work_df_check(st=st, et=et, have_long=have_long, own_type=own_type)
    check_df = df_util.df_set_index(check_df, ['城市', '门店'])
    check_df = df_util.df_drop(check_df, "去年可售入住率")
    # check_future14_df = work_df_check_future14(st=st, et=et, have_long=have_long)
    # check_future14_df = df_util.df_set_index(check_future14_df, [ '城市', '门店'])
    # check_df = pd.merge(check_df, check_future14_df, how='left', left_index=True, right_index=True)
    check_df = df_util.df_set_first_title(check_df, '入住率')
    log.info("处理【入住率】数据完成！！！")

    result_df = pd.merge(related_df, check_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率】数据完成！！！")

    adr_df = work_df_adr(st=st, et=et, have_long=have_long, own_type=own_type)
    adr_df = df_util.df_set_index(adr_df, ['城市', '门店'])
    adr_df = df_util.df_drop(adr_df, "去年ADR")
    adr_df = df_util.df_set_first_title(adr_df, 'ADR')
    log.info("处理【ADR】数据完成！！！")

    result_df = pd.merge(result_df, adr_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR】数据完成！！！")

    revpar_df = work_df_revpar(st=st, et=et, have_long=have_long, own_type=own_type)
    revpar_df = df_util.df_set_index(revpar_df, ['城市', '门店'])
    revpar_df = df_util.df_drop(revpar_df, "去年RevPar")
    revpar_df = df_util.df_set_first_title(revpar_df, 'RevPar')
    log.info("处理【RevPar】数据完成！！！")

    result_df = pd.merge(result_df, revpar_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar】数据完成！！！")

    gmv_df = work_df_gmv(st=st, et=et, have_long=have_long, own_type=own_type)
    gmv_df = df_util.df_set_index(gmv_df, ['城市', '门店'])
    gmv_df = df_util.df_set_first_title(gmv_df, 'GMV')
    log.info("处理【GMV】数据完成！！！")

    result_df = pd.merge(result_df, gmv_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV】数据完成！！！")

    orders_df = work_df_create_orders_num(st=st, et=et, have_long=have_long, own_type=own_type)
    orders_df = df_util.df_set_index(orders_df, ['城市', '门店'])
    orders_df = orders_df[['取消订单收入', '退款率']]
    orders_df = df_util.df_set_first_title(orders_df, '订单相关')
    log.info("处理【订单相关】数据完成！！！")

    result_df = pd.merge(result_df, orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关】数据完成！！！")

    channel_orders_df = work_df_channel_order_rate(st=st, et=et, have_long=have_long, own_type=own_type)
    channel_orders_df = df_util.df_set_index(channel_orders_df, ['城市', '门店'])
    channel_orders_df = df_util.df_set_first_title(channel_orders_df, '渠道占比')
    log.info("处理【渠道占比】数据完成！！！")

    result_df = pd.merge(result_df, channel_orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关、渠道占比】数据完成！！！")

    """
    过程指标【综合】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    mul_im_recovery_df = im_work_day(st=st, et=et, channel_ids=[20], has_first=False, own_type=own_type)
    mul_im_recovery_df = df_util.df_set_index(mul_im_recovery_df, ['城市', '门店'])
    mul_im_conversion_df = im_conversion_order_work_day_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_rename = {"咨询数": "24小时咨询数", "下单数": "24小时咨询后下单数"}
    mul_im_conversion_df = df_util.df_rename(mul_im_conversion_df, mul_im_rename)
    mul_im_df = pd.merge(mul_im_recovery_df, mul_im_conversion_df, how='left', left_index=True, right_index=True)
    mul_im_df = df_util.df_set_first_title(mul_im_df, 'IM相关-Airbnb')
    log.info("处理【IM相关-Airbnb】数据完成！！！")
    result_df = pd.merge(result_df, mul_im_df, how='left', left_index=True, right_index=True)

    comment_overview_work_df = comment_overview_work_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    comment_overview_work_df = df_util.df_set_first_title(comment_overview_work_df, "评论相关-综合")
    result_df = pd.merge(result_df, comment_overview_work_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【评论相关】数据完成！！！")

    comment_overview_work_df = comment_overview_work_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    comment_overview_work_df = df_util.df_set_first_title(comment_overview_work_df, "评论相关-Airbnb")
    result_df = pd.merge(result_df, comment_overview_work_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【评论相关】数据完成！！！")

    comment_overview_work_df = comment_overview_work_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    comment_overview_work_df = df_util.df_set_first_title(comment_overview_work_df, "评论相关-途家")
    result_df = pd.merge(result_df, comment_overview_work_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【评论相关】数据完成！！！")

    comment_overview_work_df = comment_overview_work_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    comment_overview_work_df = df_util.df_set_first_title(comment_overview_work_df, "评论相关-榛果")
    result_df = pd.merge(result_df, comment_overview_work_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【评论相关】数据完成！！！")

    work_brush_df = work_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3, 20, 25], own_type=own_type)
    work_brush_df = df_util.df_set_index(work_brush_df, ['城市', '门店'])
    work_brush_df = df_util.df_set_first_title(work_brush_df, "刷单-综合")
    result_df = pd.merge(result_df, work_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-综合】 数据完成！！！")

    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
    work_brush_df = work_df_brush(st=st, et=et, have_long=have_long, channel_ids=[20], own_type=own_type)
    work_brush_df = df_util.df_set_index(work_brush_df, ['城市', '门店'])
    work_brush_df = df_util.df_set_first_title(work_brush_df, "刷单-Airbnb")
    result_df = pd.merge(result_df, work_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-Airbnb】 数据完成！！！")

    work_brush_df = work_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3], own_type=own_type)
    work_brush_df = df_util.df_set_index(work_brush_df, ['城市', '门店'])
    work_brush_df = df_util.df_set_first_title(work_brush_df, "刷单-途家")
    result_df = pd.merge(result_df, work_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-途家】 数据完成！！！")

    work_brush_df = work_df_brush(st=st, et=et, have_long=have_long, channel_ids=[25], own_type=own_type)
    work_brush_df = df_util.df_set_index(work_brush_df, ['城市', '门店'])
    work_brush_df = df_util.df_set_first_title(work_brush_df, "刷单-榛果")
    result_df = pd.merge(result_df, work_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-榛果】 数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    work_channel_df = work_df_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    work_channel_df = df_util.df_set_index(work_channel_df, ['城市', '门店'])
    work_channel_df = df_util.df_set_first_title(work_channel_df, "渠道相关-综合")
    result_df = pd.merge(result_df, work_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    work_channel_df = work_df_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    work_channel_df = df_util.df_set_index(work_channel_df, ['城市', '门店'])
    work_channel_df = df_util.df_set_first_title(work_channel_df, "渠道相关-Airbnb")
    result_df = pd.merge(result_df, work_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【渠道相关】数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    work_channel_df = work_df_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    work_channel_df = df_util.df_set_index(work_channel_df, ['城市', '门店'])
    work_channel_df = df_util.df_set_first_title(work_channel_df, "渠道相关-途家")
    result_df = pd.merge(result_df, work_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    work_channel_df = work_df_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    work_channel_df = df_util.df_set_index(work_channel_df, ['城市', '门店'])
    work_channel_df = df_util.df_set_first_title(work_channel_df, "渠道相关-榛果")
    result_df = pd.merge(result_df, work_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓净利（非结算数据）后期补充 净利（非结算数据）↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    net_profit_df = work_df_net_profit(st=st, et=et, own_type=own_type)
    net_profit_df = df_util.df_set_first_title(net_profit_df, "净利（非结算数据）")
    # net_profit_df = df_util.df_set_index(net_profit_df, [  '城市', '门店'])
    result_df = pd.merge(result_df, net_profit_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【净利（非结算数据）】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑净利（非结算数据）后期补充 净利（非结算数据）↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    result_df = df_util.df_reset_index(result_df)

    colors = {"房屋相关": "#F8E0E0", "入住率": "#F7F8E0", "ADR": " #F1F8E0",
              "GMV": "#E0F8E6 ", "REPVAR": "#E0F8F7", "IM相关-Airbnb": "#F2EFFB",
              "虚拟电话": "#EFF2FB", "订单相关": "#EFFBF5",
              "渠道相关-综合": "#F2F2F2", "刷单-综合": "#F2F2F2", "评论相关-综合": "#F2F2F2",
              "渠道相关-Airbnb": "#F8ECE0", "刷单-Airbnb": "#F8ECE0", "评论相关-Airbnb": "#F8ECE0",
              "渠道相关-途家": "#EFF8FB", "刷单-途家": "#EFF8FB", "评论相关-途家": "#EFF8FB",
              "渠道相关-榛果": "#EFFBF2", "刷单-榛果": "#EFFBF2", "评论相关-榛果": "#EFFBF2"}

    return result_df, colors


def process_city_yesterday(dt=None, have_long=False, own_type=(1, 2, 3)):
    """
    过去七天
    :param dt:
    :param own_type:
    :param have_long: 是否包含长租
    :return:
    """
    yesterday = dt if dt else date_util.curdate()
    st = yesterday
    et = yesterday
    """
    【结果指标】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """

    related_df = city_df_related(st=st, et=et, have_long=have_long, own_type=own_type)
    related_df = df_util.df_set_index(related_df, ['公司', '城市'])
    related_df = df_util.df_rename(related_df, {"屏蔽间夜": "屏蔽房源"})
    # related_df = df_util.df_drop(related_df, ["同期在线房屋", "在线间夜"])
    related_df = df_util.df_set_first_title(related_df, '房屋相关')
    log.info("处理【房屋相关】数据完成！！！")

    check_df = city_df_check(st=st, et=et, have_long=have_long, own_type=own_type)
    check_df = df_util.df_set_index(check_df, ['公司', '城市'])
    check_df = df_util.df_drop(check_df, "去年可售入住率")
    city_check_future14_df = city_df_check_future14(st=st, et=et, have_long=have_long, own_type=own_type)
    city_check_future14_df = df_util.df_set_index(city_check_future14_df, ['公司', '城市'])
    check_df = pd.merge(check_df, city_check_future14_df, how='left', left_index=True, right_index=True)
    check_df = df_util.df_set_first_title(check_df, '入住率')
    log.info("处理【入住率】数据完成！！！")

    result_df = pd.merge(related_df, check_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率】数据完成！！！")

    adr_df = city_df_adr(st=st, et=et, have_long=have_long, own_type=own_type)
    adr_df = df_util.df_set_index(adr_df, ['公司', '城市'])
    adr_df = df_util.df_drop(adr_df, "去年ADR")
    city_adr_future14_df = city_df_adr_future14(st=st, et=et, have_long=have_long, own_type=own_type)
    city_adr_future14_df = df_util.df_set_index(city_adr_future14_df, ['公司', '城市'])
    adr_df = pd.merge(city_adr_future14_df, adr_df, how='right', left_index=True, right_index=True)
    adr_df = df_util.df_set_first_title(adr_df, 'ADR')
    log.info("处理【ADR】数据完成！！！")

    result_df = pd.merge(result_df, adr_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR】数据完成！！！")

    revpar_df = city_df_revpar(st=st, et=et, have_long=have_long, own_type=own_type)
    revpar_df = df_util.df_set_index(revpar_df, ['公司', '城市'])
    revpar_df = df_util.df_drop(revpar_df, "去年RevPar")
    revpar_df = df_util.df_set_first_title(revpar_df, 'RevPar')
    log.info("处理【RevPar】数据完成！！！")

    result_df = pd.merge(result_df, revpar_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar】数据完成！！！")

    # gmv_df = city_df_gmv(st=st, et=et, have_long=have_long)
    # gmv_df = df_util.df_set_index(gmv_df, ['公司', '城市'])
    # gmv_df = df_util.df_set_first_title(gmv_df, 'GMV')
    # log.info("处理【GMV】数据完成！！！")

    # result_df = pd.merge(result_df, gmv_df, how='left', left_index=True, right_index=True)
    # log.info("合并【房屋相关、入住率、ADR、RevPar、GMV】数据完成！！！")

    orders_df = city_df_create_orders_num(st=st, et=et, have_long=have_long, own_type=own_type)
    orders_df = df_util.df_set_index(orders_df, ['公司', '城市'])
    orders_df = df_util.df_set_first_title(orders_df, '订单相关')
    log.info("处理【订单相关】数据完成！！！")

    result_df = pd.merge(result_df, orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关】数据完成！！！")

    channel_orders_df = city_df_channel_order_rate(st=st, et=et, have_long=have_long, own_type=own_type)
    channel_orders_df = df_util.df_set_index(channel_orders_df, ['公司', '城市'])
    channel_orders_df = df_util.df_set_first_title(channel_orders_df, '渠道占比')
    log.info("处理【订单相关】数据完成！！！")

    result_df = pd.merge(result_df, channel_orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关】数据完成！！！")

    """
    过程指标【综合】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    mul_im_recovery_df = im_city(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_recovery_df = df_util.df_set_index(mul_im_recovery_df, ['公司', '城市'])
    mul_im_conversion_df = im_conversion_order_city_day_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_rename = {"咨询数": "24小时咨询数", "下单数": "24小时咨询后下单数"}
    mul_im_conversion_df = df_util.df_rename(mul_im_conversion_df, mul_im_rename)
    mul_im_df = pd.merge(mul_im_recovery_df, mul_im_conversion_df, how='left', left_index=True, right_index=True)

    mul_im_df = df_util.df_set_first_title(mul_im_df, 'IM相关-Airbnb')
    log.info("处理【IM相关-Airbnb】数据完成！！！")
    result_df = pd.merge(result_df, mul_im_df, how='left', left_index=True, right_index=True)

    # comment_overview_city_df = comment_overview_city_channel(st=st, et=et, channel_ids=[3, 20, 25])
    # comment_overview_city_df = df_util.df_set_first_title(comment_overview_city_df, "评论相关-综合")
    # result_df = pd.merge(result_df, comment_overview_city_df, how='left', left_index=True, right_index=True)
    # log.info("处理【过程指标-综合】【评论相关】数据完成！！！")

    comment_overview_city_df = comment_overview_city_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    comment_overview_city_df = df_util.df_set_first_title(comment_overview_city_df, "评论相关-Airbnb")
    result_df = pd.merge(result_df, comment_overview_city_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【评论相关】数据完成！！！")

    comment_overview_city_df = comment_overview_city_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    comment_overview_city_df = df_util.df_set_first_title(comment_overview_city_df, "评论相关-途家")
    result_df = pd.merge(result_df, comment_overview_city_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【评论相关】数据完成！！！")

    # comment_overview_city_df = comment_overview_city_channel(st=st, et=et, channel_ids=[25])
    # comment_overview_city_df = df_util.df_set_first_title(comment_overview_city_df, "评论相关-榛果")
    # result_df = pd.merge(result_df, comment_overview_city_df, how='left', left_index=True, right_index=True)
    # log.info("处理【过程指标-榛果】【评论相关】数据完成！！！")

    city_brush_df = city_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3, 20, 25], own_type=own_type)
    city_brush_df = df_util.df_set_index(city_brush_df, ['公司', '城市'])
    city_brush_df = df_util.df_set_first_title(city_brush_df, "刷单-综合")
    result_df = pd.merge(result_df, city_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-综合】 数据完成！！！")

    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
    city_brush_df = city_df_brush(st=st, et=et, have_long=have_long, channel_ids=[20], own_type=own_type)
    city_brush_df = df_util.df_set_index(city_brush_df, ['公司', '城市'])
    city_brush_df = df_util.df_set_first_title(city_brush_df, "刷单-Airbnb")
    result_df = pd.merge(result_df, city_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-Airbnb】 数据完成！！！")

    city_brush_df = city_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3], own_type=own_type)
    city_brush_df = df_util.df_set_index(city_brush_df, ['公司', '城市'])
    city_brush_df = df_util.df_set_first_title(city_brush_df, "刷单-途家")
    result_df = pd.merge(result_df, city_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-途家】 数据完成！！！")

    city_brush_df = city_df_brush(st=st, et=et, have_long=have_long, channel_ids=[25], own_type=own_type)
    city_brush_df = df_util.df_set_index(city_brush_df, ['公司', '城市'])
    city_brush_df = df_util.df_set_first_title(city_brush_df, "刷单-榛果")
    result_df = pd.merge(result_df, city_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-榛果】 数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    city_channel_df = city_df_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    city_channel_df = df_util.df_set_index(city_channel_df, ['公司', '城市'])
    city_channel_df = df_util.df_set_first_title(city_channel_df, "渠道相关-综合")
    result_df = pd.merge(result_df, city_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    city_channel_df = city_df_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    city_channel_df = df_util.df_set_index(city_channel_df, ['公司', '城市'])
    city_channel_df = df_util.df_set_first_title(city_channel_df, "渠道相关-Airbnb")
    result_df = pd.merge(result_df, city_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【渠道相关】数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    city_channel_df = city_df_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    city_channel_df = df_util.df_set_index(city_channel_df, ['公司', '城市'])
    city_channel_df = df_util.df_set_first_title(city_channel_df, "渠道相关-途家")
    result_df = pd.merge(result_df, city_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    city_channel_df = city_df_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    city_channel_df = df_util.df_set_index(city_channel_df, ['公司', '城市'])
    city_channel_df = df_util.df_set_first_title(city_channel_df, "渠道相关-榛果")
    result_df = pd.merge(result_df, city_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    result_df = df_util.df_reset_index(result_df)

    colors = {"房屋相关": "#F8E0E0", "入住率": "#F7F8E0", "ADR": " #F1F8E0",
              "GMV": "#E0F8E6 ", "REPVAR": "#E0F8F7", "IM相关-Airbnb": "#F2EFFB",
              "虚拟电话": "#EFF2FB", "订单相关": "#EFFBF5",
              "渠道相关-综合": "#F2F2F2", "刷单-综合": "#F2F2F2", "评论相关-综合": "#F2F2F2",
              "渠道相关-Airbnb": "#F8ECE0", "刷单-Airbnb": "#F8ECE0", "评论相关-Airbnb": "#F8ECE0",
              "渠道相关-途家": "#EFF8FB", "刷单-途家": "#EFF8FB", "评论相关-途家": "#EFF8FB",
              "渠道相关-榛果": "#EFFBF2", "刷单-榛果": "#EFFBF2", "评论相关-榛果": "#EFFBF2"}

    return result_df, colors


def process_city_seven_ago(dt=None, have_long=False, own_type=(1, 2, 3)):
    """
    过去七天
    :param dt:
    :param own_type:
    :param have_long: 是否包含长租
    :return:
    """
    yesterday = dt if dt else date_util.curdate()
    st = date_util.date_sub(dt=yesterday, days=6)
    et = yesterday
    """
    【结果指标】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    related_df = city_df_related(st=st, et=et, have_long=have_long, own_type=own_type)
    related_df = df_util.df_set_index(related_df, ['公司', '城市'])
    related_df = df_util.df_set_first_title(related_df, '房屋相关')
    log.info("处理【房屋相关】数据完成！！！")

    check_df = city_df_check(st=st, et=et, have_long=have_long, own_type=own_type)
    check_df = df_util.df_set_index(check_df, ['公司', '城市'])
    check_df = df_util.df_drop(check_df, "去年可售入住率")
    city_check_future14_df = city_df_check_future14(st=st, et=et, have_long=have_long, own_type=own_type)
    city_check_future14_df = df_util.df_set_index(city_check_future14_df, ['公司', '城市'])
    check_df = pd.merge(check_df, city_check_future14_df, how='left', left_index=True, right_index=True)
    check_df = df_util.df_set_first_title(check_df, '入住率')
    log.info("处理【入住率】数据完成！！！")

    result_df = pd.merge(related_df, check_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率】数据完成！！！")

    adr_df = city_df_adr(st=st, et=et, have_long=have_long, own_type=own_type)
    adr_df = df_util.df_set_index(adr_df, ['公司', '城市'])
    adr_df = df_util.df_drop(adr_df, "去年ADR")
    city_adr_future14_df = city_df_adr_future14(st=st, et=et, have_long=have_long, own_type=own_type)
    city_adr_future14_df = df_util.df_set_index(city_adr_future14_df, ['公司', '城市'])
    adr_df = pd.merge(city_adr_future14_df, adr_df, how='right', left_index=True, right_index=True)
    adr_df = df_util.df_set_first_title(adr_df, 'ADR')
    log.info("处理【ADR】数据完成！！！")

    result_df = pd.merge(result_df, adr_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR】数据完成！！！")

    revpar_df = city_df_revpar(st=st, et=et, have_long=have_long, own_type=own_type)
    revpar_df = df_util.df_set_index(revpar_df, ['公司', '城市'])
    revpar_df = df_util.df_drop(revpar_df, "去年RevPar")
    revpar_df = df_util.df_set_first_title(revpar_df, 'RevPar')
    log.info("处理【RevPar】数据完成！！！")

    result_df = pd.merge(result_df, revpar_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar】数据完成！！！")

    gmv_df = city_df_gmv(st=st, et=et, have_long=have_long, own_type=own_type)
    gmv_df = df_util.df_set_index(gmv_df, ['公司', '城市'])
    month_days = date_util.month_days(date_util.curdate())
    gmv_df['GMV目标'] = gmv_df.apply(lambda row: round(row['GMV目标'] / month_days * 7, 2), axis=1)
    gmv_df['GMV目标差'] = gmv_df.apply(lambda row: round(row['套均GMV【不包含刷单】'] - row['GMV目标'], 2), axis=1)
    gmv_df = df_util.df_rename(gmv_df, {"GMV目标": "七天套均GMV目标", "GMV目标差": "七天套均GMV目标差"})
    gmv_df = df_util.df_set_first_title(gmv_df, 'GMV')
    log.info("处理【GMV】数据完成！！！")

    result_df = pd.merge(result_df, gmv_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV】数据完成！！！")

    orders_df = city_df_create_orders_num(st=st, et=et, have_long=have_long, own_type=own_type)
    orders_df = df_util.df_set_index(orders_df, ['公司', '城市'])
    orders_df = df_util.df_set_first_title(orders_df, '订单相关')
    log.info("处理【订单相关】数据完成！！！")

    result_df = pd.merge(result_df, orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关】数据完成！！！")

    net_profit_df = city_df_net_profit(st=st, et=et, have_long=have_long, own_type=own_type)
    net_profit_df = df_util.df_set_index(net_profit_df, ['公司', '城市'])
    net_profit_df = df_util.df_set_first_title(net_profit_df, '净利（非结算数据）')
    log.info("处理【净利（非结算数据）】数据完成！！！")

    result_df = pd.merge(result_df, net_profit_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关、净利（非结算数据）】数据完成！！！")

    channel_orders_df = city_df_channel_order_rate(st=st, et=et, have_long=have_long, own_type=own_type)
    channel_orders_df = df_util.df_set_index(channel_orders_df, ['公司', '城市'])
    channel_orders_df = df_util.df_set_first_title(channel_orders_df, '渠道占比')
    log.info("处理【订单相关】数据完成！！！")

    result_df = pd.merge(result_df, channel_orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关、净利（非结算数据）、渠道占比】数据完成！！！")

    """
    过程指标【综合】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    mul_im_recovery_df = im_city(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_recovery_df = df_util.df_set_index(mul_im_recovery_df, ['公司', '城市'])
    mul_im_conversion_df = im_conversion_order_city_day_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_rename = {"咨询数": "24小时咨询数", "下单数": "24小时咨询后下单数"}
    mul_im_conversion_df = df_util.df_rename(mul_im_conversion_df, mul_im_rename)
    mul_im_df = pd.merge(mul_im_recovery_df, mul_im_conversion_df, how='left', left_index=True, right_index=True)

    mul_im_df = df_util.df_set_first_title(mul_im_df, 'IM相关-Airbnb')
    log.info("处理【IM相关-Airbnb】数据完成！！！")
    result_df = pd.merge(result_df, mul_im_df, how='left', left_index=True, right_index=True)

    comment_overview_city_df = comment_overview_city_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    comment_overview_city_df = df_util.df_set_first_title(comment_overview_city_df, "评论相关-综合")
    result_df = pd.merge(result_df, comment_overview_city_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【评论相关】数据完成！！！")

    comment_overview_city_df = comment_overview_city_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    comment_overview_city_df = df_util.df_set_first_title(comment_overview_city_df, "评论相关-Airbnb")
    result_df = pd.merge(result_df, comment_overview_city_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【评论相关】数据完成！！！")

    comment_overview_city_df = comment_overview_city_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    comment_overview_city_df = df_util.df_set_first_title(comment_overview_city_df, "评论相关-途家")
    result_df = pd.merge(result_df, comment_overview_city_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【评论相关】数据完成！！！")

    comment_overview_city_df = comment_overview_city_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    comment_overview_city_df = df_util.df_set_first_title(comment_overview_city_df, "评论相关-榛果")
    result_df = pd.merge(result_df, comment_overview_city_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【评论相关】数据完成！！！")

    city_brush_df = city_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3, 20, 25], own_type=own_type)
    city_brush_df = df_util.df_set_index(city_brush_df, ['公司', '城市'])
    city_brush_df = df_util.df_set_first_title(city_brush_df, "刷单-综合")
    result_df = pd.merge(result_df, city_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-综合】 数据完成！！！")

    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
    city_brush_df = city_df_brush(st=st, et=et, have_long=have_long, channel_ids=[20], own_type=own_type)
    city_brush_df = df_util.df_set_index(city_brush_df, ['公司', '城市'])
    city_brush_df = df_util.df_set_first_title(city_brush_df, "刷单-Airbnb")
    result_df = pd.merge(result_df, city_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-Airbnb】 数据完成！！！")

    city_brush_df = city_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3], own_type=own_type)
    city_brush_df = df_util.df_set_index(city_brush_df, ['公司', '城市'])
    city_brush_df = df_util.df_set_first_title(city_brush_df, "刷单-途家")
    result_df = pd.merge(result_df, city_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-途家】 数据完成！！！")

    city_brush_df = city_df_brush(st=st, et=et, have_long=have_long, channel_ids=[25], own_type=own_type)
    city_brush_df = df_util.df_set_index(city_brush_df, ['公司', '城市'])
    city_brush_df = df_util.df_set_first_title(city_brush_df, "刷单-榛果")
    result_df = pd.merge(result_df, city_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-榛果】 数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    city_channel_df = city_df_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    city_channel_df = df_util.df_set_index(city_channel_df, ['公司', '城市'])
    city_channel_df = df_util.df_set_first_title(city_channel_df, "渠道相关-综合")
    result_df = pd.merge(result_df, city_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    city_channel_df = city_df_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    city_channel_df = df_util.df_set_index(city_channel_df, ['公司', '城市'])
    city_channel_df = df_util.df_set_first_title(city_channel_df, "渠道相关-Airbnb")
    result_df = pd.merge(result_df, city_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【渠道相关】数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    city_channel_df = city_df_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    city_channel_df = df_util.df_set_index(city_channel_df, ['公司', '城市'])
    city_channel_df = df_util.df_set_first_title(city_channel_df, "渠道相关-途家")
    result_df = pd.merge(result_df, city_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    city_channel_df = city_df_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    city_channel_df = df_util.df_set_index(city_channel_df, ['公司', '城市'])
    city_channel_df = df_util.df_set_first_title(city_channel_df, "渠道相关-榛果")
    result_df = pd.merge(result_df, city_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    result_df = df_util.df_reset_index(result_df)

    colors = {"房屋相关": "#F8E0E0", "入住率": "#F7F8E0", "ADR": " #F1F8E0",
              "GMV": "#E0F8E6 ", "REPVAR": "#E0F8F7", "IM相关-Airbnb": "#F2EFFB",
              "虚拟电话": "#EFF2FB", "订单相关": "#EFFBF5",
              "渠道相关-综合": "#F2F2F2", "刷单-综合": "#F2F2F2", "评论相关-综合": "#F2F2F2",
              "渠道相关-Airbnb": "#F8ECE0", "刷单-Airbnb": "#F8ECE0", "评论相关-Airbnb": "#F8ECE0",
              "渠道相关-途家": "#EFF8FB", "刷单-途家": "#EFF8FB", "评论相关-途家": "#EFF8FB",
              "渠道相关-榛果": "#EFFBF2", "刷单-榛果": "#EFFBF2", "评论相关-榛果": "#EFFBF2"}

    return result_df, colors


def process_city_month(dt=None, have_long=False, own_type=(1, 2, 3)):
    """
    过去七天
    :param dt:
    :param own_type:
    :param have_long: 是否包含长租
    :return:
    """
    yesterday = dt if dt else date_util.curdate()
    st = date_util.cur_month_first(days=1, dt=yesterday)
    et = yesterday
    """
        【结果指标】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
        """
    related_df = city_df_related(st=st, et=et, have_long=have_long, own_type=own_type)
    related_df = df_util.df_set_index(related_df, ['公司', '城市'])
    related_df = df_util.df_set_first_title(related_df, '房屋相关')
    log.info("处理【房屋相关】数据完成！！！")

    check_df = city_df_check(st=st, et=et, have_long=have_long, own_type=own_type)
    check_df = df_util.df_set_index(check_df, ['公司', '城市'])
    check_df = df_util.df_drop(check_df, "去年可售入住率")
    city_check_future14_df = city_df_check_future14(st=st, et=et, have_long=have_long, own_type=own_type)
    city_check_future14_df = df_util.df_set_index(city_check_future14_df, ['公司', '城市'])
    check_df = pd.merge(check_df, city_check_future14_df, how='left', left_index=True, right_index=True)
    check_df = df_util.df_set_first_title(check_df, '入住率')
    log.info("处理【入住率】数据完成！！！")

    result_df = pd.merge(related_df, check_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率】数据完成！！！")

    adr_df = city_df_adr(st=st, et=et, have_long=have_long, own_type=own_type)
    adr_df = df_util.df_set_index(adr_df, ['公司', '城市'])
    adr_df = df_util.df_drop(adr_df, "去年ADR")
    city_adr_future14_df = city_df_adr_future14(st=st, et=et, have_long=have_long, own_type=own_type)
    city_adr_future14_df = df_util.df_set_index(city_adr_future14_df, ['公司', '城市'])
    adr_df = pd.merge(city_adr_future14_df, adr_df, how='right', left_index=True, right_index=True)
    adr_df = df_util.df_set_first_title(adr_df, 'ADR')
    log.info("处理【ADR】数据完成！！！")

    result_df = pd.merge(result_df, adr_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR】数据完成！！！")

    revpar_df = city_df_revpar(st=st, et=et, have_long=have_long, own_type=own_type)
    revpar_df = df_util.df_set_index(revpar_df, ['公司', '城市'])
    revpar_df = df_util.df_drop(revpar_df, "去年RevPar")
    revpar_df = df_util.df_set_first_title(revpar_df, 'RevPar')
    log.info("处理【RevPar】数据完成！！！")

    result_df = pd.merge(result_df, revpar_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar】数据完成！！！")

    gmv_df = city_df_gmv(st=st, et=et, have_long=have_long, own_type=own_type)
    gmv_df = df_util.df_set_index(gmv_df, ['公司', '城市'])
    gmv_df = df_util.df_rename(gmv_df, {"GMV目标": "七天套均GMV目标", "GMV目标差": "七天套均GMV目标差"})
    gmv_df = df_util.df_set_first_title(gmv_df, 'GMV')
    log.info("处理【GMV】数据完成！！！")

    result_df = pd.merge(result_df, gmv_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV】数据完成！！！")

    orders_df = city_df_create_orders_num(st=st, et=et, have_long=have_long, own_type=own_type)
    orders_df = df_util.df_set_index(orders_df, ['公司', '城市'])
    orders_df = df_util.df_set_first_title(orders_df, '订单相关')
    log.info("处理【订单相关】数据完成！！！")

    result_df = pd.merge(result_df, orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关】数据完成！！！")

    net_profit_df = city_df_net_profit(st=st, et=et, have_long=have_long, own_type=own_type)
    net_profit_df = df_util.df_set_index(net_profit_df, ['公司', '城市'])
    net_profit_df = df_util.df_set_first_title(net_profit_df, '净利（非结算数据）')
    log.info("处理【净利（非结算数据）】数据完成！！！")

    result_df = pd.merge(result_df, net_profit_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关、净利（非结算数据）】数据完成！！！")

    channel_orders_df = city_df_channel_order_rate(st=st, et=et, have_long=have_long, own_type=own_type)
    channel_orders_df = df_util.df_set_index(channel_orders_df, ['公司', '城市'])
    channel_orders_df = df_util.df_set_first_title(channel_orders_df, '渠道占比')
    log.info("处理【订单相关】数据完成！！！")

    result_df = pd.merge(result_df, channel_orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关、净利（非结算数据）、渠道占比】数据完成！！！")

    """
    过程指标【综合】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    mul_im_recovery_df = im_city(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_recovery_df = df_util.df_set_index(mul_im_recovery_df, ['公司', '城市'])
    mul_im_conversion_df = im_conversion_order_city_day_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_rename = {"咨询数": "24小时咨询数", "下单数": "24小时咨询后下单数"}
    mul_im_conversion_df = df_util.df_rename(mul_im_conversion_df, mul_im_rename)
    mul_im_df = pd.merge(mul_im_recovery_df, mul_im_conversion_df, how='left', left_index=True, right_index=True)

    mul_im_df = df_util.df_set_first_title(mul_im_df, 'IM相关-Airbnb')
    log.info("处理【IM相关-Airbnb】数据完成！！！")
    result_df = pd.merge(result_df, mul_im_df, how='left', left_index=True, right_index=True)

    comment_overview_city_df = comment_overview_city_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    comment_overview_city_df = df_util.df_set_first_title(comment_overview_city_df, "评论相关-综合")
    result_df = pd.merge(result_df, comment_overview_city_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【评论相关】数据完成！！！")

    comment_overview_city_df = comment_overview_city_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    comment_overview_city_df = df_util.df_set_first_title(comment_overview_city_df, "评论相关-Airbnb")
    result_df = pd.merge(result_df, comment_overview_city_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【评论相关】数据完成！！！")

    comment_overview_city_df = comment_overview_city_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    comment_overview_city_df = df_util.df_set_first_title(comment_overview_city_df, "评论相关-途家")
    result_df = pd.merge(result_df, comment_overview_city_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【评论相关】数据完成！！！")

    comment_overview_city_df = comment_overview_city_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    comment_overview_city_df = df_util.df_set_first_title(comment_overview_city_df, "评论相关-榛果")
    result_df = pd.merge(result_df, comment_overview_city_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【评论相关】数据完成！！！")

    city_brush_df = city_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3, 20, 25], own_type=own_type)
    city_brush_df = df_util.df_set_index(city_brush_df, ['公司', '城市'])
    city_brush_df = df_util.df_set_first_title(city_brush_df, "刷单-综合")
    result_df = pd.merge(result_df, city_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-综合】 数据完成！！！")

    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
    city_brush_df = city_df_brush(st=st, et=et, have_long=have_long, channel_ids=[20], own_type=own_type)
    city_brush_df = df_util.df_set_index(city_brush_df, ['公司', '城市'])
    city_brush_df = df_util.df_set_first_title(city_brush_df, "刷单-Airbnb")
    result_df = pd.merge(result_df, city_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-Airbnb】 数据完成！！！")

    city_brush_df = city_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3], own_type=own_type)
    city_brush_df = df_util.df_set_index(city_brush_df, ['公司', '城市'])
    city_brush_df = df_util.df_set_first_title(city_brush_df, "刷单-途家")
    result_df = pd.merge(result_df, city_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-途家】 数据完成！！！")

    city_brush_df = city_df_brush(st=st, et=et, have_long=have_long, channel_ids=[25], own_type=own_type)
    city_brush_df = df_util.df_set_index(city_brush_df, ['公司', '城市'])
    city_brush_df = df_util.df_set_first_title(city_brush_df, "刷单-榛果")
    result_df = pd.merge(result_df, city_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-榛果】 数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    city_channel_df = city_df_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    city_channel_df = df_util.df_set_index(city_channel_df, ['公司', '城市'])
    city_channel_df = df_util.df_set_first_title(city_channel_df, "渠道相关-综合")
    result_df = pd.merge(result_df, city_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    city_channel_df = city_df_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    city_channel_df = df_util.df_set_index(city_channel_df, ['公司', '城市'])
    city_channel_df = df_util.df_set_first_title(city_channel_df, "渠道相关-Airbnb")
    result_df = pd.merge(result_df, city_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【渠道相关】数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    city_channel_df = city_df_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    city_channel_df = df_util.df_set_index(city_channel_df, ['公司', '城市'])
    city_channel_df = df_util.df_set_first_title(city_channel_df, "渠道相关-途家")
    result_df = pd.merge(result_df, city_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    city_channel_df = city_df_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    city_channel_df = df_util.df_set_index(city_channel_df, ['公司', '城市'])
    city_channel_df = df_util.df_set_first_title(city_channel_df, "渠道相关-榛果")
    result_df = pd.merge(result_df, city_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    result_df = df_util.df_reset_index(result_df)

    colors = {"房屋相关": "#F8E0E0", "入住率": "#F7F8E0", "ADR": " #F1F8E0",
              "GMV": "#E0F8E6 ", "REPVAR": "#E0F8F7", "IM相关-Airbnb": "#F2EFFB",
              "虚拟电话": "#EFF2FB", "订单相关": "#EFFBF5",
              "渠道相关-综合": "#F2F2F2", "刷单-综合": "#F2F2F2", "评论相关-综合": "#F2F2F2",
              "渠道相关-Airbnb": "#F8ECE0", "刷单-Airbnb": "#F8ECE0", "评论相关-Airbnb": "#F8ECE0",
              "渠道相关-途家": "#EFF8FB", "刷单-途家": "#EFF8FB", "评论相关-途家": "#EFF8FB",
              "渠道相关-榛果": "#EFFBF2", "刷单-榛果": "#EFFBF2", "评论相关-榛果": "#EFFBF2"}

    return result_df, colors


def process_district_yesterday(dt=None, have_long=False, own_type=(1, 2, 3)):
    """
    过去七天
    :param dt:
    :param own_type:
    :param have_long: 是否包含长租
    :return:
    """
    yesterday = dt if dt else date_util.curdate()
    st = yesterday
    et = yesterday
    """
    【结果指标】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """

    related_df = district_df_related(st=st, et=et, have_long=have_long, own_type=own_type)
    related_df = df_util.df_set_index(related_df, ['大区', '城市'])
    related_df = df_util.df_rename(related_df, {"屏蔽间夜": "屏蔽房源"})
    # related_df = df_util.df_drop(related_df, ["同期在线房屋", "在线间夜"])
    related_df = df_util.df_set_first_title(related_df, '房屋相关')
    log.info("处理【房屋相关】数据完成！！！")

    check_df = district_df_check(st=st, et=et, have_long=have_long, own_type=own_type)
    check_df = df_util.df_set_index(check_df, ['大区'])
    check_df = df_util.df_drop(check_df, "去年可售入住率")
    district_check_future14_df = district_df_check_future14(st=st, et=et, have_long=have_long, own_type=own_type)
    district_check_future14_df = df_util.df_set_index(district_check_future14_df, ['大区'])
    check_df = pd.merge(check_df, district_check_future14_df, how='left', left_index=True, right_index=True)
    check_df = df_util.df_set_first_title(check_df, '入住率')
    log.info("处理【入住率】数据完成！！！")

    result_df = pd.merge(related_df, check_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率】数据完成！！！")

    adr_df = district_df_adr(st=st, et=et, have_long=have_long, own_type=own_type)
    adr_df = df_util.df_set_index(adr_df, ['大区'])
    adr_df = df_util.df_drop(adr_df, "去年ADR")
    district_adr_future14_df = district_df_adr_future14(st=st, et=et, have_long=have_long, own_type=own_type)
    district_adr_future14_df = df_util.df_set_index(district_adr_future14_df, ['大区'])
    adr_df = pd.merge(district_adr_future14_df, adr_df, how='right', left_index=True, right_index=True)
    adr_df = df_util.df_set_first_title(adr_df, 'ADR')
    log.info("处理【ADR】数据完成！！！")

    result_df = pd.merge(result_df, adr_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR】数据完成！！！")

    revpar_df = district_df_revpar(st=st, et=et, have_long=have_long, own_type=own_type)
    revpar_df = df_util.df_set_index(revpar_df, ['大区'])
    revpar_df = df_util.df_drop(revpar_df, "去年RevPar")
    revpar_df = df_util.df_set_first_title(revpar_df, 'RevPar')
    log.info("处理【RevPar】数据完成！！！")

    result_df = pd.merge(result_df, revpar_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar】数据完成！！！")

    orders_df = district_df_create_orders_num(st=st, et=et, have_long=have_long, own_type=own_type)
    orders_df = df_util.df_set_index(orders_df, ['大区'])
    orders_df = df_util.df_set_first_title(orders_df, '订单相关')
    log.info("处理【订单相关】数据完成！！！")

    result_df = pd.merge(result_df, orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关】数据完成！！！")

    channel_orders_df = district_df_channel_order_rate(st=st, et=et, have_long=have_long, own_type=own_type)
    channel_orders_df = df_util.df_set_index(channel_orders_df, ['大区'])
    channel_orders_df = df_util.df_set_first_title(channel_orders_df, '渠道占比')
    log.info("处理【订单相关】数据完成！！！")

    result_df = pd.merge(result_df, channel_orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关】数据完成！！！")

    """
    过程指标【综合】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    mul_im_recovery_df = im_district(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_recovery_df = df_util.df_set_index(mul_im_recovery_df, ['大区'])
    mul_im_conversion_df = im_conversion_order_district_day_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_rename = {"咨询数": "24小时咨询数", "下单数": "24小时咨询后下单数"}
    mul_im_conversion_df = df_util.df_rename(mul_im_conversion_df, mul_im_rename)
    mul_im_df = pd.merge(mul_im_recovery_df, mul_im_conversion_df, how='left', left_index=True, right_index=True)

    mul_im_df = df_util.df_set_first_title(mul_im_df, 'IM相关-Airbnb')
    log.info("处理【IM相关-Airbnb】数据完成！！！")
    result_df = pd.merge(result_df, mul_im_df, how='left', left_index=True, right_index=True)

    # comment_overview_city_df = comment_overview_city_channel(st=st, et=et, channel_ids=[3, 20, 25])
    # comment_overview_city_df = df_util.df_set_first_title(comment_overview_city_df, "评论相关-综合")
    # result_df = pd.merge(result_df, comment_overview_city_df, how='left', left_index=True, right_index=True)
    # log.info("处理【过程指标-综合】【评论相关】数据完成！！！")

    comment_overview_district_df = comment_overview_district_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    comment_overview_district_df = df_util.df_set_first_title(comment_overview_district_df, "评论相关-Airbnb")
    result_df = pd.merge(result_df, comment_overview_district_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【评论相关】数据完成！！！")

    comment_overview_district_df = comment_overview_district_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    comment_overview_district_df = df_util.df_set_first_title(comment_overview_district_df, "评论相关-途家")
    result_df = pd.merge(result_df, comment_overview_district_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【评论相关】数据完成！！！")

    # comment_overview_city_df = comment_overview_city_channel(st=st, et=et, channel_ids=[25])
    # comment_overview_city_df = df_util.df_set_first_title(comment_overview_city_df, "评论相关-榛果")
    # result_df = pd.merge(result_df, comment_overview_city_df, how='left', left_index=True, right_index=True)
    # log.info("处理【过程指标-榛果】【评论相关】数据完成！！！")

    district_brush_df = district_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3, 20, 25], own_type=own_type)
    district_brush_df = df_util.df_set_index(district_brush_df, ['大区'])
    district_brush_df = df_util.df_set_first_title(district_brush_df, "刷单-综合")
    result_df = pd.merge(result_df, district_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-综合】 数据完成！！！")

    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
    district_brush_df = district_df_brush(st=st, et=et, have_long=have_long, channel_ids=[20], own_type=own_type)
    district_brush_df = df_util.df_set_index(district_brush_df, ['大区'])
    district_brush_df = df_util.df_set_first_title(district_brush_df, "刷单-Airbnb")
    result_df = pd.merge(result_df, district_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-Airbnb】 数据完成！！！")

    district_brush_df = district_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3], own_type=own_type)
    district_brush_df = df_util.df_set_index(district_brush_df, ['大区'])
    district_brush_df = df_util.df_set_first_title(district_brush_df, "刷单-途家")
    result_df = pd.merge(result_df, district_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-途家】 数据完成！！！")

    district_brush_df = district_df_brush(st=st, et=et, have_long=have_long, channel_ids=[25], own_type=own_type)
    district_brush_df = df_util.df_set_index(district_brush_df, ['大区'])
    district_brush_df = df_util.df_set_first_title(district_brush_df, "刷单-榛果")
    result_df = pd.merge(result_df, district_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-榛果】 数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    district_channel_df = district_df_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    district_channel_df = df_util.df_set_index(district_channel_df, ['大区'])
    district_channel_df = df_util.df_set_first_title(district_channel_df, "渠道相关-综合")
    result_df = pd.merge(result_df, district_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    district_channel_df = district_df_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    district_channel_df = df_util.df_set_index(district_channel_df, ['大区'])
    district_channel_df = df_util.df_set_first_title(district_channel_df, "渠道相关-Airbnb")
    result_df = pd.merge(result_df, district_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【渠道相关】数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    district_channel_df = district_df_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    district_channel_df = df_util.df_set_index(district_channel_df, ['大区'])
    district_channel_df = df_util.df_set_first_title(district_channel_df, "渠道相关-途家")
    result_df = pd.merge(result_df, district_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    district_channel_df = district_df_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    district_channel_df = df_util.df_set_index(district_channel_df, ['大区'])
    district_channel_df = df_util.df_set_first_title(district_channel_df, "渠道相关-榛果")
    result_df = pd.merge(result_df, district_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    result_df = df_util.df_reset_index(result_df)

    colors = {"房屋相关": "#F8E0E0", "入住率": "#F7F8E0", "ADR": " #F1F8E0",
              "GMV": "#E0F8E6 ", "REPVAR": "#E0F8F7", "IM相关-Airbnb": "#F2EFFB",
              "虚拟电话": "#EFF2FB", "订单相关": "#EFFBF5",
              "渠道相关-综合": "#F2F2F2", "刷单-综合": "#F2F2F2", "评论相关-综合": "#F2F2F2",
              "渠道相关-Airbnb": "#F8ECE0", "刷单-Airbnb": "#F8ECE0", "评论相关-Airbnb": "#F8ECE0",
              "渠道相关-途家": "#EFF8FB", "刷单-途家": "#EFF8FB", "评论相关-途家": "#EFF8FB",
              "渠道相关-榛果": "#EFFBF2", "刷单-榛果": "#EFFBF2", "评论相关-榛果": "#EFFBF2"}

    return result_df, colors


def process_district_seven_ago(dt=None, have_long=False, own_type=(1, 2, 3)):
    """
    过去七天
    :param dt:
    :param own_type:
    :param have_long: 是否包含长租
    :return:
    """
    yesterday = dt if dt else date_util.curdate()
    st = date_util.date_sub(dt=yesterday, days=6)
    et = yesterday
    """
    【结果指标】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    related_df = district_df_related(st=st, et=et, have_long=have_long, own_type=own_type)
    related_df = df_util.df_set_index(related_df, ['大区', '城市'])
    related_df = df_util.df_set_first_title(related_df, '房屋相关')
    log.info("处理【房屋相关】数据完成！！！")

    check_df = district_df_check(st=st, et=et, have_long=have_long, own_type=own_type)
    check_df = df_util.df_set_index(check_df, ['大区'])
    check_df = df_util.df_drop(check_df, "去年可售入住率")
    district_check_future14_df = district_df_check_future14(st=st, et=et, have_long=have_long, own_type=own_type)
    district_check_future14_df = df_util.df_set_index(district_check_future14_df, ['大区'])
    check_df = pd.merge(check_df, district_check_future14_df, how='left', left_index=True, right_index=True)
    check_df = df_util.df_set_first_title(check_df, '入住率')
    log.info("处理【入住率】数据完成！！！")

    result_df = pd.merge(related_df, check_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率】数据完成！！！")

    adr_df = district_df_adr(st=st, et=et, have_long=have_long, own_type=own_type)
    adr_df = df_util.df_set_index(adr_df, ['大区'])
    adr_df = df_util.df_drop(adr_df, "去年ADR")
    district_adr_future14_df = district_df_adr_future14(st=st, et=et, have_long=have_long, own_type=own_type)
    district_adr_future14_df = df_util.df_set_index(district_adr_future14_df, ['大区'])
    adr_df = pd.merge(district_adr_future14_df, adr_df, how='right', left_index=True, right_index=True)
    adr_df = df_util.df_set_first_title(adr_df, 'ADR')
    log.info("处理【ADR】数据完成！！！")

    result_df = pd.merge(result_df, adr_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR】数据完成！！！")

    revpar_df = district_df_revpar(st=st, et=et, have_long=have_long, own_type=own_type)
    revpar_df = df_util.df_set_index(revpar_df, ['大区'])
    revpar_df = df_util.df_drop(revpar_df, "去年RevPar")
    revpar_df = df_util.df_set_first_title(revpar_df, 'RevPar')
    log.info("处理【RevPar】数据完成！！！")

    result_df = pd.merge(result_df, revpar_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar】数据完成！！！")

    gmv_df = district_df_gmv(st=st, et=et, have_long=have_long, own_type=own_type)
    gmv_df = df_util.df_set_index(gmv_df, ['大区'])
    month_days = date_util.month_days(date_util.curdate())
    gmv_df['GMV目标'] = gmv_df.apply(lambda row: round(row['GMV目标'] / month_days * 7, 2), axis=1)
    gmv_df['GMV目标差'] = gmv_df.apply(lambda row: round(row['套均GMV【不包含刷单】'] - row['GMV目标'], 2), axis=1)
    gmv_df = df_util.df_rename(gmv_df, {"GMV目标": "七天套均GMV目标", "GMV目标差": "七天套均GMV目标差"})
    gmv_df = df_util.df_set_first_title(gmv_df, 'GMV')
    log.info("处理【GMV】数据完成！！！")

    result_df = pd.merge(result_df, gmv_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV】数据完成！！！")

    orders_df = district_df_create_orders_num(st=st, et=et, have_long=have_long, own_type=own_type)
    orders_df = df_util.df_set_index(orders_df, ['大区'])
    orders_df = df_util.df_set_first_title(orders_df, '订单相关')
    log.info("处理【订单相关】数据完成！！！")

    result_df = pd.merge(result_df, orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关】数据完成！！！")

    net_profit_df = district_df_net_profit(st=st, et=et, have_long=have_long, own_type=own_type)
    net_profit_df = df_util.df_set_index(net_profit_df, ['大区'])
    net_profit_df = df_util.df_set_first_title(net_profit_df, '净利（非结算数据）')
    log.info("处理【净利（非结算数据）】数据完成！！！")

    result_df = pd.merge(result_df, net_profit_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关、净利（非结算数据）】数据完成！！！")

    channel_orders_df = district_df_channel_order_rate(st=st, et=et, have_long=have_long, own_type=own_type)
    channel_orders_df = df_util.df_set_index(channel_orders_df, ['大区'])
    channel_orders_df = df_util.df_set_first_title(channel_orders_df, '渠道占比')
    log.info("处理【订单相关】数据完成！！！")

    result_df = pd.merge(result_df, channel_orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关、净利（非结算数据）、渠道占比】数据完成！！！")

    """
    过程指标【综合】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    mul_im_recovery_df = im_district(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_recovery_df = df_util.df_set_index(mul_im_recovery_df, ['大区'])
    mul_im_conversion_df = im_conversion_order_district_day_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_rename = {"咨询数": "24小时咨询数", "下单数": "24小时咨询后下单数"}
    mul_im_conversion_df = df_util.df_rename(mul_im_conversion_df, mul_im_rename)
    mul_im_df = pd.merge(mul_im_recovery_df, mul_im_conversion_df, how='left', left_index=True, right_index=True)

    mul_im_df = df_util.df_set_first_title(mul_im_df, 'IM相关-Airbnb')
    log.info("处理【IM相关-Airbnb】数据完成！！！")
    result_df = pd.merge(result_df, mul_im_df, how='left', left_index=True, right_index=True)

    comment_overview_district_df = comment_overview_district_channel(st=st, et=et, channel_ids=[3, 20, 25],
                                                                     own_type=own_type)
    comment_overview_district_df = df_util.df_set_first_title(comment_overview_district_df, "评论相关-综合")
    result_df = pd.merge(result_df, comment_overview_district_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【评论相关】数据完成！！！")

    comment_overview_district_df = comment_overview_district_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    comment_overview_district_df = df_util.df_set_first_title(comment_overview_district_df, "评论相关-Airbnb")
    result_df = pd.merge(result_df, comment_overview_district_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【评论相关】数据完成！！！")

    comment_overview_district_df = comment_overview_district_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    comment_overview_district_df = df_util.df_set_first_title(comment_overview_district_df, "评论相关-途家")
    result_df = pd.merge(result_df, comment_overview_district_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【评论相关】数据完成！！！")

    comment_overview_district_df = comment_overview_district_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    comment_overview_district_df = df_util.df_set_first_title(comment_overview_district_df, "评论相关-榛果")
    result_df = pd.merge(result_df, comment_overview_district_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【评论相关】数据完成！！！")

    district_brush_df = district_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3, 20, 25], own_type=own_type)
    district_brush_df = df_util.df_set_index(district_brush_df, ['大区'])
    district_brush_df = df_util.df_set_first_title(district_brush_df, "刷单-综合")
    result_df = pd.merge(result_df, district_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-综合】 数据完成！！！")

    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
    district_brush_df = district_df_brush(st=st, et=et, have_long=have_long, channel_ids=[20], own_type=own_type)
    district_brush_df = df_util.df_set_index(district_brush_df, ['大区'])
    district_brush_df = df_util.df_set_first_title(district_brush_df, "刷单-Airbnb")
    result_df = pd.merge(result_df, district_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-Airbnb】 数据完成！！！")

    district_brush_df = district_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3], own_type=own_type)
    district_brush_df = df_util.df_set_index(district_brush_df, ['大区'])
    district_brush_df = df_util.df_set_first_title(district_brush_df, "刷单-途家")
    result_df = pd.merge(result_df, district_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-途家】 数据完成！！！")

    district_brush_df = district_df_brush(st=st, et=et, have_long=have_long, channel_ids=[25], own_type=own_type)
    district_brush_df = df_util.df_set_index(district_brush_df, ['大区'])
    district_brush_df = df_util.df_set_first_title(district_brush_df, "刷单-榛果")
    result_df = pd.merge(result_df, district_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-榛果】 数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    district_channel_df = district_df_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    district_channel_df = df_util.df_set_index(district_channel_df, ['大区'])
    district_channel_df = df_util.df_set_first_title(district_channel_df, "渠道相关-综合")
    result_df = pd.merge(result_df, district_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    district_channel_df = district_df_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    district_channel_df = df_util.df_set_index(district_channel_df, ['大区'])
    district_channel_df = df_util.df_set_first_title(district_channel_df, "渠道相关-Airbnb")
    result_df = pd.merge(result_df, district_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【渠道相关】数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    district_channel_df = district_df_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    district_channel_df = df_util.df_set_index(district_channel_df, ['大区'])
    district_channel_df = df_util.df_set_first_title(district_channel_df, "渠道相关-途家")
    result_df = pd.merge(result_df, district_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    district_channel_df = district_df_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    district_channel_df = df_util.df_set_index(district_channel_df, ['大区'])
    district_channel_df = df_util.df_set_first_title(district_channel_df, "渠道相关-榛果")
    result_df = pd.merge(result_df, district_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    result_df = df_util.df_reset_index(result_df)

    colors = {"房屋相关": "#F8E0E0", "入住率": "#F7F8E0", "ADR": " #F1F8E0",
              "GMV": "#E0F8E6 ", "REPVAR": "#E0F8F7", "IM相关-Airbnb": "#F2EFFB",
              "虚拟电话": "#EFF2FB", "订单相关": "#EFFBF5",
              "渠道相关-综合": "#F2F2F2", "刷单-综合": "#F2F2F2", "评论相关-综合": "#F2F2F2",
              "渠道相关-Airbnb": "#F8ECE0", "刷单-Airbnb": "#F8ECE0", "评论相关-Airbnb": "#F8ECE0",
              "渠道相关-途家": "#EFF8FB", "刷单-途家": "#EFF8FB", "评论相关-途家": "#EFF8FB",
              "渠道相关-榛果": "#EFFBF2", "刷单-榛果": "#EFFBF2", "评论相关-榛果": "#EFFBF2"}

    return result_df, colors


def process_district_month(dt=None, have_long=False, own_type=(1, 2, 3)):
    """
    过去七天
    :param dt:
    :param own_type:
    :param have_long: 是否包含长租
    :return:
    """
    yesterday = dt if dt else date_util.curdate()
    st = date_util.cur_month_first(days=1, dt=yesterday)
    et = yesterday
    """
    【结果指标】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    related_df = district_df_related(st=st, et=et, have_long=have_long, own_type=own_type)
    related_df = df_util.df_set_index(related_df, ['大区', '城市'])
    related_df = df_util.df_set_first_title(related_df, '房屋相关')
    log.info("处理【房屋相关】数据完成！！！")

    check_df = district_df_check(st=st, et=et, have_long=have_long, own_type=own_type)
    check_df = df_util.df_set_index(check_df, ['大区'])
    check_df = df_util.df_drop(check_df, "去年可售入住率")
    district_check_future14_df = district_df_check_future14(st=st, et=et, have_long=have_long, own_type=own_type)
    district_check_future14_df = df_util.df_set_index(district_check_future14_df, ['大区'])
    check_df = pd.merge(check_df, district_check_future14_df, how='left', left_index=True, right_index=True)
    check_df = df_util.df_set_first_title(check_df, '入住率')
    log.info("处理【入住率】数据完成！！！")

    result_df = pd.merge(related_df, check_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率】数据完成！！！")

    adr_df = district_df_adr(st=st, et=et, have_long=have_long, own_type=own_type)
    adr_df = df_util.df_set_index(adr_df, ['大区'])
    adr_df = df_util.df_drop(adr_df, "去年ADR")
    district_adr_future14_df = district_df_adr_future14(st=st, et=et, have_long=have_long, own_type=own_type)
    district_adr_future14_df = df_util.df_set_index(district_adr_future14_df, ['大区'])
    adr_df = pd.merge(district_adr_future14_df, adr_df, how='right', left_index=True, right_index=True)
    adr_df = df_util.df_set_first_title(adr_df, 'ADR')
    log.info("处理【ADR】数据完成！！！")

    result_df = pd.merge(result_df, adr_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR】数据完成！！！")

    revpar_df = district_df_revpar(st=st, et=et, have_long=have_long, own_type=own_type)
    revpar_df = df_util.df_set_index(revpar_df, ['大区'])
    revpar_df = df_util.df_drop(revpar_df, "去年RevPar")
    revpar_df = df_util.df_set_first_title(revpar_df, 'RevPar')
    log.info("处理【RevPar】数据完成！！！")

    result_df = pd.merge(result_df, revpar_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar】数据完成！！！")

    gmv_df = district_df_gmv(st=st, et=et, have_long=have_long, own_type=own_type)
    gmv_df = df_util.df_set_index(gmv_df, ['大区'])
    gmv_df = df_util.df_rename(gmv_df, {"GMV目标": "七天套均GMV目标", "GMV目标差": "七天套均GMV目标差"})
    gmv_df = df_util.df_set_first_title(gmv_df, 'GMV')
    log.info("处理【GMV】数据完成！！！")

    result_df = pd.merge(result_df, gmv_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV】数据完成！！！")

    orders_df = district_df_create_orders_num(st=st, et=et, have_long=have_long, own_type=own_type)
    orders_df = df_util.df_set_index(orders_df, ['大区'])
    orders_df = df_util.df_set_first_title(orders_df, '订单相关')
    log.info("处理【订单相关】数据完成！！！")

    result_df = pd.merge(result_df, orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关】数据完成！！！")

    net_profit_df = district_df_net_profit(st=st, et=et, have_long=have_long, own_type=own_type)
    net_profit_df = df_util.df_set_index(net_profit_df, ['大区'])
    net_profit_df = df_util.df_set_first_title(net_profit_df, '净利（非结算数据）')
    log.info("处理【净利（非结算数据）】数据完成！！！")

    result_df = pd.merge(result_df, net_profit_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关、净利（非结算数据）】数据完成！！！")

    channel_orders_df = district_df_channel_order_rate(st=st, et=et, have_long=have_long, own_type=own_type)
    channel_orders_df = df_util.df_set_index(channel_orders_df, ['大区'])
    channel_orders_df = df_util.df_set_first_title(channel_orders_df, '渠道占比')
    log.info("处理【订单相关】数据完成！！！")

    result_df = pd.merge(result_df, channel_orders_df, how='left', left_index=True, right_index=True)
    log.info("合并【房屋相关、入住率、ADR、RevPar、GMV、订单相关、净利（非结算数据）、渠道占比】数据完成！！！")

    """
    过程指标【综合】 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    """
    mul_im_recovery_df = im_district(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_recovery_df = df_util.df_set_index(mul_im_recovery_df, ['大区'])
    mul_im_conversion_df = im_conversion_order_district_day_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    mul_im_rename = {"咨询数": "24小时咨询数", "下单数": "24小时咨询后下单数"}
    mul_im_conversion_df = df_util.df_rename(mul_im_conversion_df, mul_im_rename)
    mul_im_df = pd.merge(mul_im_recovery_df, mul_im_conversion_df, how='left', left_index=True, right_index=True)

    mul_im_df = df_util.df_set_first_title(mul_im_df, 'IM相关-Airbnb')
    log.info("处理【IM相关-Airbnb】数据完成！！！")
    result_df = pd.merge(result_df, mul_im_df, how='left', left_index=True, right_index=True)

    comment_overview_district_df = comment_overview_district_channel(st=st, et=et, channel_ids=[3, 20, 25],
                                                                     own_type=own_type)
    comment_overview_district_df = df_util.df_set_first_title(comment_overview_district_df, "评论相关-综合")
    result_df = pd.merge(result_df, comment_overview_district_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【评论相关】数据完成！！！")

    comment_overview_district_df = comment_overview_district_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    comment_overview_district_df = df_util.df_set_first_title(comment_overview_district_df, "评论相关-Airbnb")
    result_df = pd.merge(result_df, comment_overview_district_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【评论相关】数据完成！！！")

    comment_overview_district_df = comment_overview_district_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    comment_overview_district_df = df_util.df_set_first_title(comment_overview_district_df, "评论相关-途家")
    result_df = pd.merge(result_df, comment_overview_district_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【评论相关】数据完成！！！")

    comment_overview_district_df = comment_overview_district_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    comment_overview_district_df = df_util.df_set_first_title(comment_overview_district_df, "评论相关-榛果")
    result_df = pd.merge(result_df, comment_overview_district_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【评论相关】数据完成！！！")

    district_brush_df = district_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3, 20, 25], own_type=own_type)
    district_brush_df = df_util.df_set_index(district_brush_df, ['大区'])
    district_brush_df = df_util.df_set_first_title(district_brush_df, "刷单-综合")
    result_df = pd.merge(result_df, district_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-综合】 数据完成！！！")

    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
    district_brush_df = district_df_brush(st=st, et=et, have_long=have_long, channel_ids=[20], own_type=own_type)
    district_brush_df = df_util.df_set_index(district_brush_df, ['大区'])
    district_brush_df = df_util.df_set_first_title(district_brush_df, "刷单-Airbnb")
    result_df = pd.merge(result_df, district_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-Airbnb】 数据完成！！！")

    district_brush_df = district_df_brush(st=st, et=et, have_long=have_long, channel_ids=[3], own_type=own_type)
    district_brush_df = df_util.df_set_index(district_brush_df, ['大区'])
    district_brush_df = df_util.df_set_first_title(district_brush_df, "刷单-途家")
    result_df = pd.merge(result_df, district_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-途家】 数据完成！！！")

    district_brush_df = district_df_brush(st=st, et=et, have_long=have_long, channel_ids=[25], own_type=own_type)
    district_brush_df = df_util.df_set_index(district_brush_df, ['大区'])
    district_brush_df = df_util.df_set_first_title(district_brush_df, "刷单-榛果")
    result_df = pd.merge(result_df, district_brush_df, how='left', left_index=True, right_index=True)
    log.info("处理【刷单-榛果】 数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    district_channel_df = district_df_channel(st=st, et=et, channel_ids=[3, 20, 25], own_type=own_type)
    district_channel_df = df_util.df_set_index(district_channel_df, ['大区'])
    district_channel_df = df_util.df_set_first_title(district_channel_df, "渠道相关-综合")
    result_df = pd.merge(result_df, district_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-综合】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    district_channel_df = district_df_channel(st=st, et=et, channel_ids=[20], own_type=own_type)
    district_channel_df = df_util.df_set_index(district_channel_df, ['大区'])
    district_channel_df = df_util.df_set_first_title(district_channel_df, "渠道相关-Airbnb")
    result_df = pd.merge(result_df, district_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-Airbnb】【渠道相关】数据完成！！！")

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    district_channel_df = district_df_channel(st=st, et=et, channel_ids=[3], own_type=own_type)
    district_channel_df = df_util.df_set_index(district_channel_df, ['大区'])
    district_channel_df = df_util.df_set_first_title(district_channel_df, "渠道相关-途家")
    result_df = pd.merge(result_df, district_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-途家】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    # todo      ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓【渠道相关 在线情况 直连情况】↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
    district_channel_df = district_df_channel(st=st, et=et, channel_ids=[25], own_type=own_type)
    district_channel_df = df_util.df_set_index(district_channel_df, ['大区'])
    district_channel_df = df_util.df_set_first_title(district_channel_df, "渠道相关-榛果")
    result_df = pd.merge(result_df, district_channel_df, how='left', left_index=True, right_index=True)
    log.info("处理【过程指标-榛果】【渠道相关】数据完成！！！")
    # todo      ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑【渠道相关 在线情况 直连情况】↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    result_df = df_util.df_reset_index(result_df)

    colors = {"房屋相关": "#F8E0E0", "入住率": "#F7F8E0", "ADR": " #F1F8E0",
              "GMV": "#E0F8E6 ", "REPVAR": "#E0F8F7", "IM相关-Airbnb": "#F2EFFB",
              "虚拟电话": "#EFF2FB", "订单相关": "#EFFBF5",
              "渠道相关-综合": "#F2F2F2", "刷单-综合": "#F2F2F2", "评论相关-综合": "#F2F2F2",
              "渠道相关-Airbnb": "#F8ECE0", "刷单-Airbnb": "#F8ECE0", "评论相关-Airbnb": "#F8ECE0",
              "渠道相关-途家": "#EFF8FB", "刷单-途家": "#EFF8FB", "评论相关-途家": "#EFF8FB",
              "渠道相关-榛果": "#EFFBF2", "刷单-榛果": "#EFFBF2", "评论相关-榛果": "#EFFBF2"}

    return result_df, colors


if __name__ == '__main__':
    # df1, co = process_house_yesterday(own_type=(1, 2))
    # df2, co2 = process_house_seven_ago(own_type=(1, 2))
    # df3, co3 = process_house_month(own_type=(1, 2))
    # a = {"日": df1, "周": df2, "月": df3}
    # excel_util.pd_to_excel(a, "df_house", engine='xlsxwriter')

    df1, co = process_work_yesterday(own_type=(1, 2))
    df2, co2 = process_work_seven_ago(own_type=(1, 2))
    df3, co3 = process_work_month(own_type=(1, 2))
    a = {"日": df1, "周": df2, "月": df3}
    excel_util.pd_to_excel(a, "df_work", engine='xlsxwriter')
    #
    # df1, co = process_city_yesterday(own_type=(1, 2))
    # df2, co2 = process_city_seven_ago(own_type=(1, 2))
    # df3, co3 = process_city_month(own_type=(1, 2))
    # a = {"日": df1, "周": df2, "月": df3}
    # excel_util.pd_to_excel(a, "df_city", engine='xlsxwriter')
    #
    # df1, co = process_district_yesterday(own_type=(1, 2))
    # df2, co2 = process_district_seven_ago(own_type=(1, 2))
    # df3, co3 = process_district_month(own_type=(1, 2))
    # a = {"日": df1, "周": df2, "月": df3}
    # excel_util.pd_to_excel(a, "df_district", engine='xlsxwriter')
    #
    # df1, co = process_city_yesterday(own_type=(1, 2))
    # df2, co2 = process_city_seven_ago(own_type=(1, 2))
    # df3, co3 = process_city_month(own_type=(1, 2))
    # # df4, co3 = process_city_month(own_type=(1, 2), dt='2019-11-30')
    # a = {"日": df1, "周": df2, "月": df3}
    # # a = {"月": df3}
    # excel_util.pd_to_excel(a, "df_city", engine='xlsxwriter')
    # df4, co3 = process_work_month(own_type=(1, 2), dt='2018-11-30')
    # df5, co5 = process_work_month(own_type=(1, 2), dt='2018-12-31')
    # excel_util.pd_to_excel({"18年11月": df4, "18年12月": df5}, "df_work_1", engine='xlsxwriter')
